Hello,
I'm currently working on a method that checks if a given date is valid.
My solution looks like this:
Func _Valid($Check) $match = StringRegExp($Check,"^(\d{2})\.(\d{2})\.(\d{4})$",1) If IsArray($match) then If Mod($match[1],2) = 0 And $match[0] > 30 Then Return False If Mod($match[1],2) = 1 And $match[0] > 31 Then Return False If Mod($match[2],4) = 0 And $match[0] > 29 then Return False If Mod($match[2],4) <> 0 And $match[0] > 28 then Return False Return True Else Return False EndIf EndFunc
I haven't included leap years like 1600,2000,2400, which is fine for my purpose.
I wonder if my function works 100% right?
But what I'm really interested in is: What is the most compact function to do this job?
Or how do YOU validate dates?
Thanks