Mintoris Forum

Author Topic: IsDate-Function in a Sub  (Read 991 times)

CDPeter

  • Full Member
  • ***
  • Posts: 25
IsDate-Function in a Sub
« 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

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: IsDate-Function in a Sub
« Reply #1 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.

CDPeter

  • Full Member
  • ***
  • Posts: 25
Re: IsDate-Function in a Sub
« Reply #2 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

Chuck

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1899
Re: IsDate-Function in a Sub
« Reply #3 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.