Owners of B&G H5000-based systems may have noted that B&G includes information about how to configure and control the system via a "websocket" interface.
One of my projects has been to capture the H5000 CPU websocket data (which is sometimes different from what's available on the NMEA0183 and N2K interfaces) via a really simple application that can be run on a Raspberry Pi. (Instead of running, for example, Expedition on a laptop to capture the data--no sense running a fully powered-up laptop when something with much lower electrical draw will suit.)
Anyway, here's my question (hoping that someone from B&G monitors this forum):
The "UTC Date" data item (ID 34) comes in this format:
(where the fields are: id, valid, value, system_value, damped_value, instance, damped)
For the life of me, I can't figure out how to translate 2459090 to a sensible date (this number represents October 9, 2020). It looks like the number increases by 1 per day (so 2459092 would be October 11). Most computer integer representations of dates are based on "number of days since..." where the "since" refers to 1/1/1901, 1/1/1970, or similar. But this number goes back to something like 4500 BCE.
I can certainly hack the calculation, but I'd be interested in a more elegant way, if it exists. Anyone know what the format is?
If You're Interested
By the way, if anyone's interested in logging this data on a Pi (or any other computer), let me know and I'll put it up on GitHub. I build and run it in Linux for the Raspberry Pi, but I develop it on a Windows machine, so I think (maybe with some modest changes) it can run on any Windows or Linux machine. I use it both for calibrating my instruments and maintaining a "VDR-type" log of all of my sailing--it's useful for analyzing performance after the fact.