On This Page

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 ​

This example returns 1,485,216,000:

print todatetime( "2015-25-24" )