mirror of
git://git.musl-libc.org/musl
synced 2024-12-24 23:52:48 +00:00
fix POSIX-format TZ dst transition times for southern hemisphere
the time of day at which daylight time switches over is specified in local time in the dst state prior to the transition. the code for handling this wrongly assumed it needed to switch whether dst or standard offset is applied to the transition time when the dst end date is before the dst start date (souther hemisphere summer), but in fact the end transition time should always be adjusted for dst, and the start transition time should always be adjusted for standard time.
This commit is contained in:
parent
74bca42e16
commit
dbff2bb889
@ -373,18 +373,14 @@ void __secs_to_zone(long long t, int local, int *isdst, long *offset, long *oppo
|
||||
long long t0 = rule_to_secs(r0, y);
|
||||
long long t1 = rule_to_secs(r1, y);
|
||||
|
||||
if (!local) {
|
||||
t0 += __timezone;
|
||||
t1 += dst_off;
|
||||
}
|
||||
if (t0 < t1) {
|
||||
if (!local) {
|
||||
t0 += __timezone;
|
||||
t1 += dst_off;
|
||||
}
|
||||
if (t >= t0 && t < t1) goto dst;
|
||||
goto std;
|
||||
} else {
|
||||
if (!local) {
|
||||
t1 += __timezone;
|
||||
t0 += dst_off;
|
||||
}
|
||||
if (t >= t1 && t < t0) goto std;
|
||||
goto dst;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user