mirror of
https://git.freebsd.org/src.git
synced 2026-01-12 06:54:03 +00:00
libc: Add "Z" as TZ designator for strptime.
ISO 8601 allows use of "Z" as the time zone designator. Update the strptime parser to allow this usage. While we are at it, update the manpage to reflect that both UTC and Z are now valid options. Reviewed by: des MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53083
This commit is contained in:
parent
4548b9f3a8
commit
79e57ea662
2 changed files with 3 additions and 2 deletions
|
|
@ -171,7 +171,7 @@ is taken as noon.
|
|||
The
|
||||
.Fa %Z
|
||||
format specifier only accepts time zone abbreviations of the local time zone,
|
||||
or the value "GMT".
|
||||
and the values "GMT", "UTC", or "Z".
|
||||
This limitation is because of ambiguity due to of the over loading of time
|
||||
zone abbreviations.
|
||||
One such example is
|
||||
|
|
|
|||
|
|
@ -546,7 +546,8 @@ label:
|
|||
zonestr[cp - buf] = '\0';
|
||||
tzset();
|
||||
if (0 == strcmp(zonestr, "GMT") ||
|
||||
0 == strcmp(zonestr, "UTC")) {
|
||||
0 == strcmp(zonestr, "UTC") ||
|
||||
0 == strcmp(zonestr, "Z")) {
|
||||
*GMTp = 1;
|
||||
} else if (0 == strcmp(zonestr, tzname[0])) {
|
||||
tm->tm_isdst = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue