The TextToDateTimeValidate function is a built-in function that returns true if Text t can be converted to a Date Time value.

You can use this function before converting the Text value to a Date Time value with the TextToDateTime function.

Input parameters

t: Text Type

Output parameters

Boolean Type

Examples

Usage

Result

TextToDateTimeValidate( "2002-01-01 01:01:01" )

True

TextToDateTimeValidate( "2002/01/01 01:01:01" )

True

TextToDateTimeValidate( "2002.01.01 01:01:01" )

True

TextToDateTimeValidate( "20-01-01 01:01:01" )

False

TextToDateTimeValidate( "date time" )

False

TextToDateTimeValidate( "2002.1.1 1-1-1" )

False

TextToDateTimeValidate( "2002-01-01" )

True

TextToDateTimeValidate( "01-01-01" )

True

Remarks

You should check the limits of the DateTime data type. You should also ensure that the date you type in the argument complies with the Date Format of the server which is, by default, YYYY-MM-DD, but may have been changed by your Service Center administrator.

See Also

TextToDateTime Function | Available Conversion Functions to Date Time | Available Built-in Functions