EPOCH_MS_TO_DATE
Description
EPOCH_MS_TO_DATE
is a row function that converts LONG
values to DATE
values, where the input number represents the number of milliseconds since the epoch.Syntax
EPOCH_MS_TO_DATE
(long_expression
)Return Value
Returns one value per row of type
DATE
in UTC format yyyy-MM-dd HH:mm:ss:SSS Z
.Input Parameters
- long_expression
- Required. A field or expression of typeLONGrepresenting the number of milliseconds since the epoch date (January 1, 1970 00:00:00:000 GMT).
Examples
Convert a number representing the number of milliseconds from the epoch to a human-readable date and time:
EPOCH_MS_TO_DATE(1360260240000) returns
or February 7, 2013 18:04:00:000 GMT2013-02-07T18:04:00:000Z
Or if your data is in seconds instead of milliseconds:
EPOCH_MS_TO_DATE(1360260240 * 1000) returns
or February 7, 2013 18:04:00:000 GMT2013-02-07T18:04:00:000Z