The TextToDate function is a built-in function that converts Text t to a date value.

If t can't be converted to a valid Date value, the function will return the Date default value. To check if the conversion is possible you can use the TextToDateValidate function.

Input parameters

t: Text Type

Output parameters

Date type

Examples

Usage

Result

TextToDate( "2002-01-01" )

#2002-01-01#

TextToDate( "2002/01/01" )

#2002-01-01#

TextToDate( "2002.01.01" )

#2002-01-01#

TextToDate( "2002-25-01" )

#1900-01-01#

TextToDate( "2002/02/31" )

#1900-01-01#

TextToDate( "10000.01.01" )

#1900-01-01#

Remarks

You should check the limits of the Date data type. You should also ensure that the date you type in the argument complies with the default date format (YYYY-MM-DD, YYYY/MM/DD, and YYYY.MM.DD) or the server’s environment configuration.

See Also

TextToDateValidate Function | Available Conversion Functions to Date | Available Built-in Functions