`card.location` time in UTC?

I need time in UTC as accurately as possible, is the time from card.location always UTC as retrieved from the GPS?

Yes, it’s “always UTC” in the sense that it’s a UNIX timestamp (specifically elapsed seconds since Jan 1st 1970 00:00 UTC). The Notecard will always update its internal clock to maintain the most accurate time whenever it connects to a cell tower.

Ok, thanks. So it is based on cellular and not GPS? From the docs I can see that card Requests - API Reference - Blues Wireless Developers is based on cellular, but that one is also not UTC.

The Notecard uses the cellular network time the first time it connects after initial power-up. Upon syncing with Notehub, it uses the time provided from Notehub. We do trust the GPS and the Notehub-provided times equally. All of the times are UNIX timestamps, which are based on UTC.

1 Like

So, what happens in Y2038? I’ve have begun hearing a lot of chatter about Unix Datestamps and the 2038-pocolypse.

Valid question, even though we are a few years away :slight_smile:

In a nutshell:

  • Notehub should have few, to no, issues.
  • Notecard will have some issues but nothing involving more than several days of work
  • The integrated cjson portion of the C API libraries, which are currently focused on being optimal for MCUs with very small amounts of SRAM, will need to be enhanced to default to 64-bit, and we will likely do this through a compilation flag.

OK. Just asking. I was around for and quite active in fixing Y2K for a company back then and that was 22 years ago now. 22 years from NOW will be 2044.

Yes, that is surreal (and mildly depressing :slight_smile:)