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".



_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to