79369747

Date: 2025-01-19 21:02:10
Score: 0.5
Natty:
Report link

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.

Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: hawkfish