mirror of
git://sourceware.org/git/glibc.git
synced 2025-02-17 13:00:43 +08:00
Support TZ transition times < 00:00:00.
This is needed for version-3 tz-format files; it supports time stamps past 2037 for America/Godthab (the only entry in the tz database for which this change is relevant). * manual/time.texi (TZ Variable): Document transition times from -167:59:59 through -00:00:01. * time/tzset.c (tz_rule): Time of day is now signed. (__tzset_parse_tz): Parse negative time of day.
This commit is contained in:
parent
4480e934cc
commit
0748546f66
@ -1,5 +1,14 @@
|
|||||||
2013-12-17 Paul Eggert <eggert@cs.ucla.edu>
|
2013-12-17 Paul Eggert <eggert@cs.ucla.edu>
|
||||||
|
|
||||||
|
Support TZ transition times < 00:00:00.
|
||||||
|
This is needed for version-3 tz-format files; it supports time
|
||||||
|
stamps past 2037 for America/Godthab (the only entry in the tz
|
||||||
|
database for which this change is relevant).
|
||||||
|
* manual/time.texi (TZ Variable): Document transition times
|
||||||
|
from -167:59:59 through -00:00:01.
|
||||||
|
* time/tzset.c (tz_rule): Time of day is now signed.
|
||||||
|
(__tzset_parse_tz): Parse negative time of day.
|
||||||
|
|
||||||
Document TZ transition times >= 25:00:00.
|
Document TZ transition times >= 25:00:00.
|
||||||
* manual/time.texi (TZ Variable): Document transition times from
|
* manual/time.texi (TZ Variable): Document transition times from
|
||||||
25:00:00 through 167:59:59. These are already supported, and this
|
25:00:00 through 167:59:59. These are already supported, and this
|
||||||
|
4
NEWS
4
NEWS
@ -170,6 +170,10 @@ Version 2.18
|
|||||||
* On Linux, the clock function now uses the clock_gettime system call
|
* On Linux, the clock function now uses the clock_gettime system call
|
||||||
for improved precision, rather than old times system call.
|
for improved precision, rather than old times system call.
|
||||||
|
|
||||||
|
* Added support for version-3 tz format files. This is needed when using
|
||||||
|
the tz database release 2013e or later, and affects a few unusual cases --
|
||||||
|
currently only TZ='America/Godthab' for time stamps after 2037.
|
||||||
|
|
||||||
* Added new API functions pthread_getattr_default_np and
|
* Added new API functions pthread_getattr_default_np and
|
||||||
pthread_setattr_default_np to get and set the default pthread
|
pthread_setattr_default_np to get and set the default pthread
|
||||||
attributes of a process.
|
attributes of a process.
|
||||||
|
@ -2087,7 +2087,7 @@ between @code{1} and @code{12}.
|
|||||||
The @var{time} fields specify when, in the local time currently in
|
The @var{time} fields specify when, in the local time currently in
|
||||||
effect, the change to the other time occurs. If omitted, the default is
|
effect, the change to the other time occurs. If omitted, the default is
|
||||||
@code{02:00:00}. The hours part of the time fields can range from
|
@code{02:00:00}. The hours part of the time fields can range from
|
||||||
0 through 167; this is an extension to POSIX.1, which allows
|
@minus{}167 through 167; this is an extension to POSIX.1, which allows
|
||||||
only the range 0 through 24.
|
only the range 0 through 24.
|
||||||
|
|
||||||
Here are some example @code{TZ} values, including the appropriate
|
Here are some example @code{TZ} values, including the appropriate
|
||||||
@ -2123,6 +2123,16 @@ is a placeholder.
|
|||||||
WART4WARST,J1/0,J365/25
|
WART4WARST,J1/0,J365/25
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
|
Western Greenland Time (WGT) and Western Greenland Summer Time (WGST)
|
||||||
|
are 3 hours behind UTC in the winter. Its clocks follow the European
|
||||||
|
Union rules of springing forward by one hour on March's last Sunday at
|
||||||
|
01:00 UTC (@minus{}02:00 local time) and falling back on October's
|
||||||
|
last Sunday at 01:00 UTC (@minus{}01:00 local time).
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
WGT3WGST,M3.5.0/-2,M10.5.0/-1
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
The schedule of Daylight Saving Time in any particular jurisdiction has
|
The schedule of Daylight Saving Time in any particular jurisdiction has
|
||||||
changed over the years. To be strictly correct, the conversion of dates
|
changed over the years. To be strictly correct, the conversion of dates
|
||||||
and times in the past should be based on the schedule that was in effect
|
and times in the past should be based on the schedule that was in effect
|
||||||
|
@ -54,7 +54,7 @@ typedef struct
|
|||||||
/* When to change. */
|
/* When to change. */
|
||||||
enum { J0, J1, M } type; /* Interpretation of: */
|
enum { J0, J1, M } type; /* Interpretation of: */
|
||||||
unsigned short int m, n, d; /* Month, week, day. */
|
unsigned short int m, n, d; /* Month, week, day. */
|
||||||
unsigned int secs; /* Time of day. */
|
int secs; /* Time of day. */
|
||||||
|
|
||||||
long int offset; /* Seconds east of GMT (west if < 0). */
|
long int offset; /* Seconds east of GMT (west if < 0). */
|
||||||
|
|
||||||
@ -362,9 +362,12 @@ __tzset_parse_tz (tz)
|
|||||||
else if (*tz == '/')
|
else if (*tz == '/')
|
||||||
{
|
{
|
||||||
/* Get the time of day of the change. */
|
/* Get the time of day of the change. */
|
||||||
|
int negative;
|
||||||
++tz;
|
++tz;
|
||||||
if (*tz == '\0')
|
if (*tz == '\0')
|
||||||
goto out;
|
goto out;
|
||||||
|
negative = *tz == '-';
|
||||||
|
tz += negative;
|
||||||
consumed = 0;
|
consumed = 0;
|
||||||
switch (sscanf (tz, "%hu%n:%hu%n:%hu%n",
|
switch (sscanf (tz, "%hu%n:%hu%n:%hu%n",
|
||||||
&hh, &consumed, &mm, &consumed, &ss, &consumed))
|
&hh, &consumed, &mm, &consumed, &ss, &consumed))
|
||||||
@ -379,7 +382,7 @@ __tzset_parse_tz (tz)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
tz += consumed;
|
tz += consumed;
|
||||||
tzr->secs = (hh * 60 * 60) + (mm * 60) + ss;
|
tzr->secs = (negative ? -1 : 1) * ((hh * 60 * 60) + (mm * 60) + ss);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
/* Default to 2:00 AM. */
|
/* Default to 2:00 AM. */
|
||||||
|
Loading…
Reference in New Issue
Block a user