-
Notifications
You must be signed in to change notification settings - Fork 107
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Subject of the issue
- The leap year calculation yields that 2022 is a leap year; but next leap year is 2024.
- As a result of this, epoch time calculation error is 86400 s (24 h) wrong.
Your workbench
SparkFun_u-blox_GNSS_Arduino_Library](https://github.com/sparkfun/SparkFun_u-blox_GNSS_Arduino_Library Library V2.2.0
Steps to reproduce
The error is located in the calculation perfomed in
SparkFun_u-blox_GNSS_Arduino_Library/src/SparkFun_u-blox_GNSS_Arduino_Library.cpp
Line 16124 in 6eea877
DAYS_SINCE_MONTH[((uint32_t)packetUBXNAVPVT->data.year - 1970) & 3][(uint32_t)packetUBXNAVPVT->data.month] + |
and
const uint16_t DAYS_SINCE_MONTH[4][16] = |
Expected behavior
2022 is not a leap year
Actual behavior
DAYS_SINCE_MONTH[((uint32_t)packetUBXNAVPVT->data.year - 1970) & 3][(uint32_t)packetUBXNAVPVT->data.month] results as a leap year
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working