Show Menu
ARGOMENTI×

toDateTime

Converts parameters into a date time value, depending on their types.

Category

Conversion

Function syntax

toDateTime(<parameters>)

Parameters

Parameter
Type
date time in ISO-8601 format
string
time zone id
string
date time without time zone
dateTimeOnly
integer value of an epoch in milliseconds
integer
Time zone id must be a string constant. It cannot be a field reference nor an expression. For more informtation on data types, refer to Data types .

Signatures and returned types

toDateTime(<string>)
toDateTime(<dateTimeOnly>,<stringified time zone id>)
toDateTime(<integer>)
Return a dateTime .

Examples

toDateTime ("2016-08-18T23:17:59.123Z")
Returns 2016-08-18T23:17:59.123Z
toDateTime(toDateTimeOnly("2016-08-18T23:17:59.123"),"UTC")
Returns 2016-08-18T23:17:59.123Z
toDateTime(1560762190189)
Returns 2019-06-17T09:03:10.189Z