joeycastillo / Sensor-Watch

A board replacement for the classic Casio F-91W wristwatch
Other
1.17k stars 234 forks source link

Bug in `watch_utility_date_time_to_unix_time` for leap years #261

Closed rieck closed 10 months ago

rieck commented 1 year ago

There seems to be a bug in the conversion between the watch_date_time struct and unix timestamps for leap years. The function watch_utility_date_time_to_unix_time in watch_utility.c incorrectly adds an extra day when converting to a Unix timestamp.

In my understanding, the dates and the timestamps should be identical, as we are just moving back and forth between representations. Maybe I am missing something here. I plan to look into the respective conversion functions later today but wanted to report the issue already now.

Best regards & thanks for this awesome project, Konrad