Mintoris Forum

Basic => Programming => Code snippets => Topic started by: CDPeter on Dec 16, 2017, 11:04 PM

Title: IsDate-Function in a Sub
Post by: CDPeter on Dec 16, 2017, 11:04 PM
Hi,
I wrote a little sub, which checks if an given date is a real date. Then it gives back 1, otherwise it gives back 2 or more (described in Rem-section at the end of the code). It works for dates in german format, but I think, it is not really hard, to change it for other formats, e.g. american date format.
Have fun with it,
Greets from Germany,
Peter
Title: Re: IsDate-Function in a Sub
Post by: Chuck on Jan 30, 2018, 11:17 PM
Someone try the attached sub and see if it works. I think it will work for any date time format.
Title: Re: IsDate-Function in a Sub
Post by: CDPeter on Feb 01, 2018, 08:45 PM
Hi Chuck,
I'm sorry, but with a German format dd.mm.yyyy every date - possible or not - the parsetimes-function  returns -1. With the format from the example in the reference it returns everytime a valid date, even it is not possible.
Greets Peter
Title: Re: IsDate-Function in a Sub
Post by: Chuck on Feb 04, 2018, 12:09 AM
I worked on the ParseTime() function today and made it work the way I expected it to work. If you are in the alpha test group, you can test it once you get 7.900.113.