Home > Mobile >  Converting an entire column from Uni Time (Epoch) to a human readable timestamp in Snowflake. Strang
Converting an entire column from Uni Time (Epoch) to a human readable timestamp in Snowflake. Strang

Time:12-16

I used this code:

SELECT dateadd(S, START_EPOCH, '19700101')

1639075874000 got converted into 53910-11-15 14:08:21.000

Anyone know what I've done wrong and how to fix it?

CodePudding user response:

It looks like 1639075874000 is a number of milisecods, thus division by 1000 is required:

SELECT dateadd(second, START_EPOCH/1000, '1970-01-01'::TIMESTAMP)
  • Related