This commit is contained in:
J. Nick Koston
2026-01-29 21:53:06 -06:00
parent ea83330ab9
commit e1df75fc9b
2 changed files with 2 additions and 4 deletions
+1 -2
View File
@@ -160,8 +160,7 @@ static void parse_transition_time(const char *&p, DSTRule &rule) {
}
}
void julian_to_month_day(int julian_day, int year, int &out_month, int &out_day) {
(void) year; // Unused - J format ignores leap years by design
void julian_to_month_day(int julian_day, int &out_month, int &out_day) {
// J format: day 1-365, Feb 29 is NOT counted even in leap years
// So day 60 is always March 1
static const int DAYS_BEFORE_MONTH[] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
+1 -2
View File
@@ -94,10 +94,9 @@ bool parse_dst_rule(const char *&p, DSTRule &rule);
/// Convert Julian day (J format, 1-365 not counting Feb 29) to month/day
/// @param julian_day Day number 1-365
/// @param year The year (for leap year calculation)
/// @param[out] month Output: month 1-12
/// @param[out] day Output: day of month
void julian_to_month_day(int julian_day, int year, int &month, int &day);
void julian_to_month_day(int julian_day, int &month, int &day);
/// Convert day of year (plain format, 0-365 counting Feb 29) to month/day
/// @param day_of_year Day number 0-365