Are you still keeping an eye on this repo?
I spotted a bug in the MTC hh:mm:ss display. I am writing my own python based clock based on the glss algorithm information, and used Mars Clock as a cross check of my implementation.
The bug:
millis = 947,116,815,000 ¦ MTC 23:59:59
millis = 947,116,816,000 ¦ MTC 23:59:60
millis = 947,116,817,000 ¦ MTC 00:00:01
The seconds is rolling over from 59 to 60, instead of to zero and incrementing the minutes. That looks like the fractional seconds are being rounded for the seconds display value, but because it is not really the next second (minute) yet, the minutes do not increment. For a clock display, I think that should truncate (or use floor), so that the seconds value does not increment until the tenths of a second truly rolls over.
Those times are a few seconds off from what I expected from https://www.giss.nasa.gov/tools/mars24/help/algorithm.html and the near coincident worked example for 2000/01/06. 2000/01/06 00:00:00 should be MTC 23:59:39 (21 seconds before Mars midnight) A glance at the code shows that you are using a fixed value of 37 for the tai-utc offset. That likely accounts for the difference. I implemented a table lookup to handle the changing offset. Only works from 1972/01/01 forward.
Are you still keeping an eye on this repo?
I spotted a bug in the MTC hh:mm:ss display. I am writing my own python based clock based on the glss algorithm information, and used Mars Clock as a cross check of my implementation.
The bug:
millis = 947,116,815,000 ¦ MTC 23:59:59
millis = 947,116,816,000 ¦ MTC 23:59:60
millis = 947,116,817,000 ¦ MTC 00:00:01
The seconds is rolling over from 59 to 60, instead of to zero and incrementing the minutes. That looks like the fractional seconds are being rounded for the seconds display value, but because it is not really the next second (minute) yet, the minutes do not increment. For a clock display, I think that should truncate (or use floor), so that the seconds value does not increment until the tenths of a second truly rolls over.
Those times are a few seconds off from what I expected from https://www.giss.nasa.gov/tools/mars24/help/algorithm.html and the near coincident worked example for 2000/01/06. 2000/01/06 00:00:00 should be MTC 23:59:39 (21 seconds before Mars midnight) A glance at the code shows that you are using a fixed value of 37 for the tai-utc offset. That likely accounts for the difference. I implemented a table lookup to handle the changing offset. Only works from 1972/01/01 forward.