The DateTimeToText function is a built-in function that converts DateTime dt to a text value in which the date component is formatted according to the server's environment configuration (by default, YYYY-MM-DD).

Input parameters

dt: DateTime Type

Output parameters

Text Type

Examples

Usage

Result

DateTimeToText( #2015-05-21 22:20:30# )

"2015-05-21 22:20:30"

DateTimeToText( #2015-05-21# )

"2015-05-21 00:00:00"

DateTimeToText( #22:20:30# )

"1900-01-01 22:20:30"

Remarks

You should check the limits of the DateTime data type.

See Also

Available Conversion Functions to Text | Available Built-in Functions