So, why would Totext() return a quarter before real value, when apply to Time field?

There’s two things you need to know:

  • Coda tracks time relative to 1/1/1900 for some reason. This is unconventional but I cannot say if it’s a bug or a design choice I can’t yet see the reason of. The result is that 11 AM is basically 11 AM 1/1/1900 or something.

  • Coda did not program timezones — IANA did. Coda just took an existing library. The problem with IANA though is that it only reliably tracks historical time changes since sometime 1900, and apparently before 1900 there were all sorts of weird regional offsets.

This here says that before Jan 1 1901, Spain GMT offset was -0:14:44:

Then there was some royal decree that standardized times starting from 1901:

That’s basically the story there. Working with date/time and timezones has been the biggest PITA for software developers ever since, particularly because of all these quirks. While it is strange that Coda decided to base their dates on 1900 and not 1970 like it’s universally done (and would’ve probably avoided this) I believe they had their reasons, as I learned over time that they’ve usually had.

4 Likes