Why doesn't Now().toSeconds() give the correct epoch time?

@Paul_Danyliuk @Federico.Stefanato @Johg_Ananda @Ryan_Martens2

Any idea why Now().ToSeconds().EpochToDate() doesn’t return today’s date?

was playing with @Ben_Lieber1 | @Ben_Lieber 's doc Epoch Time Converter

Because Coda calculates time not based on 1/1/1970 but on 1/1/1900, which mimics how Excel used to do it since forever.

That’s why what you get from Now().ToSeconds() is not an Unix epoch but 70 years’ worth more of seconds. To adjust, subtract Date(1970, 1, 1).ToSeconds() from it.

BTW the 1900 date system is the reason why bugs like this exist:

3 Likes