AnsweredAssumed Answered

Determining If Text String Would Be A Valid Date

Question asked by johnhorner on Feb 4, 2013
Latest reply on Feb 4, 2013 by johnhorner

Title

Determining If Text String Would Be A Valid Date

Post

     i hope this is an easy one... is there a way to test to see if a string of text would constitute a valid date?  for example:

     "John Smith" (not valid)

     "Dec" (not valid)

     "07/15/13" (valid)

     the reason is because i have a global search field that the user can enter in search criteria.  a script then uses this criteria to look for matching records based on several different fields.  most of the fields are text fields and this works fine.  however, if i search for a match in a date field and use a string that is not valid, it fails.  so i want to determine if it is valid before using it to search any date fields.

     any thoughts much appreciated.

Outcomes