The epoch_ms
function takes an integral number of milliseconds and returns a TIMESTAMP
, but I think your data has 100ns accuracy?
select epoch_ms(133782998237203223 // 100_000);
-- 2012-05-24 03:26:22.372
The to_timestamp
function takes a DOUBLE
in seconds and returns a TIMESTAMP WITH TIME ZONE
:
select to_timestamp(133782998237203223 / 10_000_000);
-- 2012-05-23 20:26:22.372032-07
(displayed in America/Los_Angeles
)
Both values will be instants and not naïve (local) timestamps.