|
Message-ID: <IGOThaBbQ5xnPGl1MXBDvGHznS3Ca6DQxxYzxIfBi2ixgXUGJradw6NwoqExVkjVdTf-y_MmdlB09u4OPlDFqtGl1YP2RSK1cuH9LdXM7LM=@pm.me>
Date: Fri, 22 Mar 2024 19:56:47 +0000
From: Alexander Weps <exander77@...me>
To: "musl@...ts.openwall.com" <musl@...ts.openwall.com>
Subject: Broken mktime calculations when crossing DST boundary
Consider this struct tm for in CET (Europe/Prague):
tm_sec: 3
tm_min: 59
tm_hour: 1
tm_mday: 31
tm_mon: 2
tm_year: 124
tm_wday: 0
tm_yday: 90
tm_isdst: 0
Representing:
2024-03-31 01:59:02
Add a minute and call mktime (crossing DST boundary).
Instead of getting:
2024-03-31 03:00:02
You get:
2024-03-31 01:00:02
tm_sec: 3
tm_min: 0
tm_hour: 1
tm_mday: 31
tm_mon: 2
tm_year: 124
tm_wday: 0
tm_yday: 90tm_isdst: 0
Not only We are going backwards, DST flag is not even set.
Glibc behaves correctly:
tm_sec: 3
tm_min: 0
tm_hour: 3
tm_mday: 31
tm_mon: 2
tm_year: 124
tm_wday: 0
tm_yday: 90tm_isdst: 1
tm_hour = 3 and tm_isdst = 1
This pretty messes with my cron tool that rely on mktime being able to correctly calculate struct tm after incrementing fields.
AW
Content of type "text/html" skipped
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.