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

unixtime_nanoseconds_todatetime

The unixtime_nanoseconds_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

unixtime_nanoseconds_todatetime( Nanoseconds )

Arguments

  • Nanoseconds: An epoch timestamp in nanoseconds. Time that occurs before the Unix epoch (1970-01-01 00:00:00) has a negative timestamp value.

Returns

If the conversion is successful, the result will be a datetime value (Unix time in seconds). Otherwise, the result will be null.

Example

unixtime_nanoseconds_todatetime(1546300800000000000) returns as 1546300800