Home / Search/ Language Reference/ Functions/ Scalar Functions/ DateTime Functions/todatetime

todatetime

The todatetime function converts the input into a datetime value (Unix time in seconds).

To convert datetime (Unix time) into a string, or vice versa, use the strftime and strptime functions.

Syntax

todatetime( Expression )

Arguments

  • Expression: Expression that will be converted into datetime.

Returns

If the conversion is successful, the result will be a datetime value, otherwise, the result will be null.

Example

todatetime("2015-12-24") returns as 1450915200