| 68 | } |
| 69 | |
| 70 | static std::int32_t GetTruncatedJDN(std::int32_t day, std::int32_t mon, std::int32_t year) noexcept |
| 71 | { |
| 72 | // Make the year positive to avoid problems with negative numbers division |
| 73 | year += 4800; |
| 74 | |
| 75 | // Months are counted from March here |
| 76 | std::int32_t month; |
| 77 | if (mon >= 2 /*March*/) { |
| 78 | month = mon - 2; |
| 79 | } else { |
| 80 | month = mon + 10; |
| 81 | year--; |
| 82 | } |
| 83 | |
| 84 | return ((year / 100) * DAYS_PER_400_YEARS) / 4 + ((year % 100) * DAYS_PER_4_YEARS) / 4 |
| 85 | + (month * DAYS_PER_5_MONTHS + 2) / 5 + day - JDN_OFFSET; |
| 86 | } |
| 87 | |
| 88 | static struct tm* GetLocalTm(const time_t* ticks, struct tm* temp) noexcept |
| 89 | { |
no outgoing calls
no test coverage detected