is a date
Michael Doub
mikedoub at gmail.com
Sat Oct 14 16:37:45 EDT 2017
What about this from the Master Library from Ken Ray?
function isDate pWhat
/* isDate Date
Syntax:
isDate (pWhat)
Examples:
isDate("10/10/2001")
Description:
Determines if the container passed to it in <pWhat> contains a valid
date.
Returns true or false.
Source:
Ken Ray, sdtlib 1.0b
isDate */
convert pWhat to short date
return not(the result is "invalid date")
end isDate
On 10/14/17 3:52 PM, J. Landman Gay via use-livecode wrote:
> On 10/14/17 2:14 PM, Yves COPPE via use-livecode wrote:
>> Try this
>>
>> function CheckDate pDateToCheck
>>
>> return
>> matchText(pDateToCheck,"([1-9]|[12][0-9]|3[01])/(0[1-9]|1[0-2])/([0-9][0-9][0-9][0-9])")
>>
>> end CheckDate
>
> Promising, but fails with dates like "1/1/19".
>
More information about the use-livecode
mailing list