Skip to content

Commit 54fa934

Browse files
committed
Fix daylight savings time issues
1 parent cc0b259 commit 54fa934

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ccronexpr.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,11 @@ static int closest_weekday(int day_of_month, int month, int year) {
218218

219219
static void set_field(struct tm* calendar, int field, int val) {
220220
*get_field_ptr(calendar, field) = val;
221+
#ifdef CRON_USE_LOCAL_TIME
222+
/* Reset the isdst field to ensure we cross daylight savings time
223+
boundaries correctly */
224+
calendar->tm_isdst = -1;
225+
#endif
221226
/* Reset day of month after month change to it's maximum. */
222227
if (field == CRON_CF_MONTH) {
223228
val = last_day_of_month(calendar->tm_mon, calendar->tm_year, 0);

0 commit comments

Comments
 (0)