History log of /src/lib/libc/time/strftime.c |
Revision | | Date | Author | Comments |
1.57 |
| 23-Jan-2025 |
christos | update to 2025a
Changes to code
strftime %s now generates the correct numeric string even when the represented number does not fit into time_t. This is better than generating the numeric equivalent of (time_t) -1, as strftime did in TZDB releases 96a (when %s was introduced) through 2020a and in releases 2022b through 2024b. It is also better than failing and returning 0, as strftime did in releases 2020b through 2022a.
strftime now outputs an invalid conversion specifier as-is, instead of eliding the leading '%', which confused debugging.
An invalid TZ now generates the time zone abbreviation "-00", not "UTC", to help the user see that an error has occurred. (Thanks to Arthur David Olson for suggesting a "wrong result".)
mktime and timeoff no longer incorrectly fail merely because a struct tm component near INT_MIN or INT_MAX overflows when a lower-order component carries into it.
TZNAME_MAXIMUM, the maximum number of bytes in a proleptic TZ string's time zone abbreviation, now defaults to 254 not 255. This helps reduce the size of internal state from 25480 to 21384 on common platforms. This change should not be a problem, as nobody uses such long "abbreviations" and the longstanding tzcode maximum was 16 until release 2023a. For those who prefer no arbitrary limits, you can now specify TZNAME_MAXIMUM values up to PTRDIFF_MAX, a limit forced by C anyway; formerly tzcode silently misbehaved unless TZNAME_MAXIMUM was less than INT_MAX.
tzset and related functions no longer leak a file descriptor if another thread forks or execs at about the same time and if the platform has O_CLOFORK and O_CLOEXEC respectively. Also, the functions no longer let a TZif file become a controlling terminal.
'zdump -' now reads TZif data from /dev/stdin. (From a question by Arthur David Olson.)
|
1.56 |
| 07-Jun-2024 |
riastradh | libc/locale: Nix needless size_t casts.
No functional change intended. No binary change to aarch64 libc.
Prompted by code inspection around PR lib/58319.
|
1.55 |
| 18-Feb-2024 |
kre | Revert this part:
strftime %s now uses tm_gmtoff if available. (Problem and draft patch reported by Dag-Erling Smørgrav.)
of the tzcode2924a update. It is bogus. The "problem" is/was a simple misunderstanding of what strftime(%s) is intended to output. The "fix" breaks it.
|
1.54 |
| 17-Feb-2024 |
christos | Sync with tzcode2024a: Release 2024a - 2024-02-01 09:28:56 -0800
Changes to code
The FROM and TO columns of Rule lines can no longer be "minimum" or an abbreviation of "minimum", because TZif files do not support DST rules that extend into the indefinite past - although these rules were supported when TZif files had only 32-bit data, this stopped working when 64-bit TZif files were introduced in 1995. This should not be a problem for realistic data, since DST was first used in the 20th century. As a transition aid, FROM columns like "minimum" are now diagnosed and then treated as if they were the year 1900; this should suffice for TZif files on old systems with only 32-bit time_t, and it is more compatible with bugs in 2023c-and-earlier localtime.c. (Problem reported by Yoshito Umaoka.)
localtime and related functions no longer mishandle some timestamps that occur about 400 years after a switch to a time zone with a DST schedule. In 2023d data this problem was visible for some timestamps in November 2422, November 2822, etc. in America/Ciudad_Juarez. (Problem reported by Gilmore Davidson.)
strftime %s now uses tm_gmtoff if available. (Problem and draft patch reported by Dag-Erling Smørgrav.)
Changes to build procedure
The leap-seconds.list file is now copied from the IERS instead of from its downstream counterpart at NIST, as the IERS version is now in the public domain too and tends to be more up-to-date. (Thanks to Martin Burnicki for liaisoning with the IERS.)
Changes to documentation
The strftime man page documents which struct tm members affect which conversion specs, and that tzset is called. (Problems reported by Robert Elz and Steve Summit.)
|
1.53 |
| 20-Jan-2024 |
christos | Catch up with all the lint warnings since exit on warning was disabled. Disable 'missing header declaration' and 'nested extern' warnings for now.
|
1.52 |
| 16-Sep-2023 |
christos | Update tzcode from 2022g to 2023c:
Release 2023c - 2023-03-28 12:42:14 -0700
Release 2023b - 2023-03-23 19:50:38 -0700
Release 2023a - 2023-03-22 12:39:33 -0700
Changes to code
You can now tell tzselect local time, to simplify later choices. Select the 'time' option in its first prompt.
You can now compile with -DTZNAME_MAXIMUM=N to limit time zone abbreviations to N bytes (default 255). The reference runtime library now rejects POSIX-style TZ strings that contain longer abbreviations, treating them as UTC. Previously the limit was platform dependent and abbreviations were silently truncated to 16 bytes even when the limit was greater than 16.
The code by default is now designed for C99 or later. To build in a C89 environment, compile with -DPORT_TO_C89. To support C89 callers of the tzcode library, compile with -DSUPPORT_C89. The two new macros are transitional aids planned to be removed in a future version, when C99 or later will be required.
The code now builds again on pre-C99 platforms, if you compile with -DPORT_TO_C89. This fixes a bug introduced in 2022f.
On C23-compatible platforms tzcode no longer uses syntax like 'static [[noreturn]] void usage(void);'. Instead, it uses '[[noreturn]] static void usage(void);' as strict C23 requires. (Problem reported by Houge Langley.)
The code's functions now constrain their arguments with the C 'restrict' keyword consistently with their documentation. This may allow future optimizations.
zdump again builds standalone with ckdadd and without setenv, fixing a bug introduced in 2022g. (Problem reported by panic.)
leapseconds.awk can now process a leap seconds file that never expires; this might be useful if leap seconds are discontinued.
Changes to commentary
tz-link.html has a new section "Coordinating with governments and distributors". (Thanks to Neil Fuller for some of the text.)
To improve tzselect diagnostics, zone1970.tab's comments column is now limited to countries that have multiple timezones.
Note that leap seconds are planned to be discontinued by 2035.
|
1.51 |
| 11-Dec-2022 |
christos | Merge in 2022g:
Although tzcode still works with C89, bugs found in recent routine maintenance indicate that bitrot has set in and that in practice C89 is no longer used to build tzcode. As it is a maintenance burden, support for C89 is planned to be removed soon. Instead, please use compilers compatible with C99, C11, C17, or C23.
timegm, which tzcode implemented in 1989, will finally be standardized 34 years later as part of C23, so timegm is now supported even if STD_INSPIRED is not defined.
Fix bug in zdump's tzalloc emulation on hosts that lack tm_zone. (Problem reported by Đoàn Trần Công Danh.)
Fix bug in zic on hosts where malloc(0) yields NULL on success. (Problem reported by Tim McBrayer for AIX 6.1.)
Fix zic configuration to avoid linkage failures on some platforms. (Problems reported by Gilmore Davidson and Igor Ivanov.)
Work around MS-Windows nmake incompatibility with POSIX. (Problem reported by Manuela Friedrich.)
Port mktime and strftime to debugging platforms where accessing uninitialized data has undefined behavior (strftime problem reported by Robert Elz).
Check more carefully for unlikely integer overflows, preferring C23 <stdckdint.h> to overflow checking by hand, as the latter has had obscure bugs.
|
1.50 |
| 16-Aug-2022 |
christos | Welcome to 2022b:
zic has a new option '-R @N' to output explicit transitions < N. (Need suggested by Almaz Mingaleev.)
'zic -r @N' no longer outputs bad data when N < first transition. (Problem introduced in 2021d and reported by Peter Krefting.)
zic now checks its input for NUL bytes and unterminated lines, and now supports input line lengths up to 2048 (not 512) bytes.
gmtime and related code now use the abbreviation "UTC" not "GMT". POSIX is being revised to require this.
When tzset and related functions set vestigial static variables like tzname, they now prefer specified timestamps to unspecified ones. (Problem reported by Almaz Mingaleev.)
zic no longer complains "can't determine time zone abbreviation to use just after until time" when a transition to a new standard time occurs simultanously with the first DST fallback transition.
|
1.49 |
| 22-Oct-2021 |
christos | Change to code and documentation from 2021a -> 2021e
Release 2021e - 2021-10-21 18:41:00 -0700
Changes to code
none
Release 2021d - 2021-10-15 13:48:18 -0700
Changes to code
'zic -r' now uses "-00" time zone abbreviations for intervals with UT offsets that are unspecified due to -r truncation. This implements a change in draft Internet RFC 8536bis.
Release 2021c - 2021-10-01 14:21:49 -0700
Changes to code
Fix a bug in 'zic -b fat' that caused old timestamps to be mishandled in 32-bit-only readers (problem reported by Daniel Fischer).
Changes to documentation
Distribute the SECURITY file (problem reported by Andreas Radke).
Release 2021b - 2021-09-24 16:23:00 -0700
Changes to maintenance procedure
The new file SECURITY covers how to report security-related bugs.
Several backward-compatibility links have been moved to the 'backward' file. These links, which range from Africa/Addis_Ababa to Pacific/Saipan, are only for compatibility with now-obsolete guidelines suggesting an entry for every ISO 3166 code. The intercontinental convenience links Asia/Istanbul and Europe/Nicosia have also been moved to 'backward'.
Changes to code
zic now creates each output file or link atomically, possibly by creating a temporary file and then renaming it. This avoids races where a TZ setting would temporarily stop working while zic was installing a replacement file or link.
zic -L no longer omits the POSIX TZ string in its output. Starting with 2020a, zic -L truncated its output according to the "Expires" directive or "#expires" comment in the leapseconds file. The resulting TZif files omitted daylight saving transitions after the leap second table expired, which led to far less-accurate predictions of times after the expiry. Although future timestamps cannot be converted accurately in the presence of leap seconds, it is more accurate to convert near-future timestamps with a few seconds error than with an hour error, so zic -L no longer truncates output in this way.
Instead, when zic -L is given the "Expires" directive, it now outputs the expiration by appending a no-change entry to the leap second table. Although this should work well with most TZif readers, it does not conform to Internet RFC 8536 and some pickier clients (including tzdb 2017c through 2021a) reject it, so "Expires" directives are currently disabled by default. To enable them, set the EXPIRES_LINE Makefile variable. If a TZif file uses this new feature it is marked with a new TZif version number 4, a format intended to be documented in a successor to RFC 8536.
zic -L LEAPFILE -r @LO no longer generates an invalid TZif file that omits leap second information for the range LO..B when LO falls between two leap seconds A and B. Instead, it generates a TZif version 4 file that represents the previously-missing information.
The TZif reader now allows the leap second table to begin with a correction other than -1 or +1, and to contain adjacent transitions with equal corrections. This supports TZif version 4.
The TZif reader now lets leap seconds occur less than 28 days apart. This supports possible future TZif extensions.
Fix bug that caused 'localtime' etc. to crash when TZ was set to a all-year DST string like "EST5EDT4,0/0,J365/25" that does not conform to POSIX but does conform to Internet RFC 8536.
Fix another bug that caused 'localtime' etc. to crash when TZ was set to a POSIX-conforming but unusual TZ string like "EST5EDT4,0/0,J365/0", where almost all the year is DST.
Fix yet another bug that caused 'localtime' etc. to mishandle slim TZif files containing leap seconds after the last explicit transition in the table, or when handling far-future timestamps in slim TZif files lacking leap seconds.
Fix localtime misbehavior involving positive leap seconds. This change affects only behavior for "right" system time, which contains leap seconds, and only if the UT offset is not a multiple of 60 seconds when a positive leap second occurs. (No such timezone exists in tzdb, luckily.) Without the fix, the timestamp was ambiguous during a positive leap second. With the fix, any seconds occurring after a positive leap second and within the same localtime minute are counted through 60, not through 59; their UT offset (tm_gmtoff) is the same as before. Here is how the fix affects timestamps in a timezone with UT offset +01:23:45 (5025 seconds) and with a positive leap second at 1972-06-30 23:59:60 UTC (78796800):
time_t without the fix with the fix 78796800 1972-07-01 01:23:45 1972-07-01 01:23:45 (leap second) 78796801 1972-07-01 01:23:45 1972-07-01 01:23:46 ... 78796815 1972-07-01 01:23:59 1972-07-01 01:23:60 78796816 1972-07-01 01:24:00 1972-07-01 01:24:00
Fix an unlikely bug that caused 'localtime' etc. to misbehave if civil time changes a few seconds before time_t wraps around, when leap seconds are enabled.
Fix bug in zic -r; in some cases, the dummy time type after the last time transition disagreed with the TZ string, contrary to Internet RFC 8563 section 3.3.
Fix a bug with 'zic -r @X' when X is a negative leap second that has a nonnegative correction. Without the fix, the output file was truncated so that X appeared to be a positive leap second. Fix a similar, even-less-likely bug when truncating at a positive leap second that has a nonpositive correction.
zic -r now reports an error if given rolling leap seconds, as this usage has never generally worked and is evidently unused.
zic now generates a POSIX-conforming TZ string for TZif files where all-year DST is predicted for the indefinite future. For example, for all-year Eastern Daylight Time, zic now generates "XXX3EDT4,0/0,J365/23" where it previously generated "EST5EDT,0/0,J365/25" or "". (Thanks to Michael Deckers for noting the possibility of POSIX conformance.)
zic.c no longer requires sys/wait.h (thanks to spazmodius for noting it wasn't needed).
When reading slim TZif files, zdump no longer mishandles leap seconds on the rare platforms where time_t counts leap seconds, fixing a bug introduced in 2014g.
zdump -v now outputs timestamps at boundaries of what localtime and gmtime can represent, instead of the less-useful timestamps one day after the minimum and one day before the maximum. (Thanks to Arthur David Olson for prototype code, and to Manuela Friedrich for debugging help.)
zdump's -c and -t options are now consistently inclusive for the lower time bound and exclusive for the upper. Formerly they were inconsistent. (Confusion noted by Martin Burnicki.)
Changes to build procedure
You can now compile with -DHAVE_MALLOC_ERRNO=0 to port to non-POSIX hosts where malloc doesn't set errno. (Problem reported by Jan Engelhardt.)
Changes to documentation
tzfile.5 better matches a draft successor to RFC 8536 <https://datatracker.ietf.org/doc/draft-murchison-rfc8536bis/01/>.
|
1.48 |
| 09-Oct-2020 |
christos | Merge tzcode2020b (except we keep tzsetwall(3) for now for compatibility, and we were "slim" already)
Support for zic's long-obsolete '-y YEARISTYPE' option has been removed and, with it, so has support for the TYPE field in Rule lines, which is now reserved for compatibility with earlier zic. These features were previously deprecated in release 2015f. (Thanks to Tim Parenti.)
zic now defaults to '-b slim' instead of to '-b fat'.
zic's new '-l -' and '-p -' options uninstall any existing localtime and posixrules files, respectively.
The undocumented and ineffective tzsetwall function has been removed.
|
1.47 |
| 25-May-2020 |
christos | Bring in 2020a
|
1.46 |
| 07-Apr-2019 |
christos | don't print ???, requested by kre@
|
1.45 |
| 07-Apr-2019 |
christos | Don't try to print NULL if we can't get a timezone name. First we try dst, then we try the non-dst name and finally we just print ??? if that did not work. This is not needed to handle the "TZ= date" case which was crashing before because the default timezone was not consistently initialized, but should handle any timezone now.
|
1.44 |
| 05-Apr-2019 |
christos | - Padding support from FreeBSD (GNU extensions) - add '+' for the c-locale only.
|
1.43 |
| 04-Apr-2019 |
christos | Make strftime_{l,z} re-entrant and always require a non-NULL timezone to be passed in so that we can use the current timezone in all evaluations (mktime tzgetname). Reported by Hamilton Slye.
|
1.42 |
| 19-Oct-2018 |
christos | Update to 2018f:
Changes to code
zic now always generates TZif files where time type 0 is used for timestamps before the first transition. This simplifies the reading of TZif files and should not affect behavior of existing TZif readers because the same set of time types is used; only their internal indexes may have changed. This affects only the legacy zones EST5EDT, CST6CDT, MST7MDT, PST8PDT, CET, MET, and EET, which previously used nonzero types for these timestamps.
Because of the type 0 change, zic no longer outputs a dummy transition at time -2**59 (before the Big Bang), as clients should no longer need this to handle historical timestamps correctly. This reverts a change introduced in 2013d and shrinks most TZif files by a few bytes.
zic now supports negative time-of-day in Rule and Leap lines, e.g., "Rule X min max - Apr lastSun -6:00 1:00 -" means the transition occurs at 18:00 on the Saturday before the last Sunday in April. This behavior was documented in 2018a but the code did not entirely match the documentation.
localtime.c no longer requires at least one time type in TZif files that lack transitions or have a POSIX-style TZ string. This future-proofs the code against possible future extensions to the format that would allow TZif files with POSIX-style TZ strings and without transitions or time types.
A read-access subscript error in localtime.c has been fixed. It could occur only in TZif files with timecnt == 0, something that does not happen in practice now but could happen in future versions.
localtime.c no longer ignores TZif POSIX-style TZ strings that specify only standard time. Instead, these TZ strings now override the default time type for timestamps after the last transition (or for all time stamps if there are no transitions), just as DST strings specifying DST have always done.
leapseconds.awk now outputs "#updated" and "#expires" comments, and supports leap seconds at the ends of months other than June and December. (Inspired by suggestions from Chris Woodbury.)
Changes to documentation
New restrictions: A Rule name must start with a character that is neither an ASCII digit nor "-" nor "+", and an unquoted name should not use characters in the set "!$%&'()*,/:;<=>?@[\]^`{|}~". The latter restriction makes room for future extensions (a possibility noted by Tom Lane).
tzfile.5 now documents what time types apply before the first and after the last transition, if any.
Documentation now uses the spelling "timezone" for a TZ setting that determines timestamp history, and "time zone" for a geographic region currently sharing the same standard time.
The name "TZif" is now used for the tz binary data format.
tz-link.htm now mentions the A0 TimeZone Migration utilities. (Thanks to Aldrin Martoq for the link.)
|
1.41 |
| 04-May-2018 |
christos | branches: 1.41.2; Merge 2018e
Changes to code
zic now accepts subsecond precision in expressions like 00:19:32.13, which is approximately the legal time of the Netherlands from 1835 to 1937. However, because it is questionable whether the few recorded uses of non-integer offsets had subsecond precision in practice, there are no plans for tzdata to use this feature. (Thanks to Steve Allen for pointing out the limitations of historical data in this area.)
The code is a bit more portable to MS-Windows. Installers can compile with -DRESERVE_STD_EXT_IDS on MS-Windows platforms that reserve identifiers like 'localtime'. (Thanks to Manuela Friedrich).
Changes to documentation and commentary
theory.html now outlines tzdb's extensions to POSIX's model for civil time, and has a section "POSIX features no longer needed" that lists POSIX API components that are now vestigial. (From suggestions by Steve Summit.) It also better distinguishes time zones from tz regions. (From a suggestion by Guy Harris.)
Commentary is now more consistent about using the phrase "daylight saving time", to match the C name tm_isdst. Daylight saving time need not occur in summer, and need not have a positive offset from standard time.
Commentary about historical transitions in Uruguay has been expanded with links to many relevant legal documents. (Thanks to Tim Parenti.)
Commentary now uses some non-ASCII characters with Unicode value less than U+0100, as they can be useful and should work even with older editors such as XEmacs.
|
1.40 |
| 24-Oct-2017 |
christos | branches: 1.40.2; Welcome to 2017c:
zic and the reference runtime now reject multiple leap seconds within 28 days of each other, or leap seconds before the Epoch. As a result, support for double leap seconds, which was obsolescent and undocumented, has been removed. Double leap seconds were an error in the C89 standard; they have never existed in civil timekeeping. (Thanks to Robert Elz and Bradley White for noticing glitches in the code that uncovered this problem.)
zic now warns about use of the obsolescent and undocumented -y option, and about use of the obsolescent TYPE field of Rule lines.
zic now allows unambiguous abbreviations like "Sa" and "Su" for weekdays; formerly it rejected them due to a bug. Conversely, zic no longer considers non-prefixes to be abbreviations; for example, it no longer accepts "lF" as an abbreviation for "lastFriday". Also, zic warns about the undocumented usage with a "last-" prefix, e.g., "last-Fri".
Similarly, zic now accepts the unambiguous abbreviation "L" for "Link" in ordinary context and for "Leap" in leap-second context. Conversely, zic no longer accepts non-prefixes such as "La" as abbreviations for words like "Leap".
zic no longer accepts leap second lines in ordinary input, or ordinary lines in leap second input. Formerly, zic sometimes warned about this undocumented usage and handled it incorrectly.
The new macro HAVE_TZNAME governs whether the tzname external variable is exported, instead of USG_COMPAT. USG_COMPAT now governs only the external variables "timezone" and "daylight". This change is needed because the three variables are not in the same category: although POSIX requires tzname, it specifies the other two variables as optional. Also, USG_COMPAT is now 1 or 0: if not defined, the code attempts to guess it from other macros.
localtime.c and difftime.c no longer require stdio.h, and .c files other than zic.c no longer require sys/wait.h.
zdump.c no longer assumes snprintf. (Reported by Jonathan Leffler.)
Calculation of time_t extrema works around a bug in GCC 4.8.4 (Reported by Stan Shebs and Joseph Myers.)
zic.c no longer mistranslates formats of line numbers in non-English locales. (Problem reported by Benno Schulenberg.)
Several minor changes have been made to the code to make it a bit easier to port to MS-Windows and Solaris. (Thanks to Kees Dekker for reporting the problems.)
Changes to documentation and commentary
The two new files 'theory.html' and 'calendars' contain the contents of the removed file 'Theory'. The goal is to document tzdb theory more accessibly.
The zic man page now documents abbreviation rules.
tz-link.htm now covers how to apply tzdata changes to clients. (Thanks to Jorge Fábregas for the AIX link.) It also mentions MySQL.
The leap-seconds.list URL has been updated to something that is more reliable for tzdb. (Thanks to Tim Parenti and Brian Inglis.)
|
1.39 |
| 11-Mar-2017 |
christos | merge 2017a
|
1.38 |
| 20-Oct-2016 |
christos | branches: 1.38.2; welcome to 2016h
|
1.37 |
| 07-Oct-2016 |
christos | merge tzcode2016g
|
1.36 |
| 15-Mar-2016 |
christos | branches: 1.36.2; Sync with 2016b
|
1.35 |
| 09-Oct-2015 |
christos | Release 2015g - 2015-10-01 00:39:51 -0700
Changes affecting code
localtime no longer mishandles America/Anchorage after 2037. (Thanks to Bradley White for reporting the bug.)
The localtime module allows the variables 'timezone', 'daylight', and 'altzone' to be in common storage shared with other modules, and declares them in case the system <time.h> does not. (Problems reported by Kees Dekker.)
On platforms with tm_zone, strftime.c now assumes it is not NULL. This simplifies the code and is consistent with zdump.c. (Problem reported by Christos Zoulas.)
Changes affecting documentation
The tzfile man page now documents that transition times denote the starts (not the ends) of the corresponding time periods. (Ambiguity reported by Bill Seymour.)
|
1.34 |
| 13-Aug-2015 |
christos | merge 2015f
|
1.33 |
| 07-Oct-2014 |
christos | Sync with tzcode2014h
|
1.32 |
| 18-Sep-2014 |
christos | make more descriptors that we open as close-on-exec
|
1.31 |
| 15-Aug-2014 |
christos | merge tzcode2014f via patch
|
1.30 |
| 26-Dec-2013 |
christos | branches: 1.30.4; update from tzcode 2013e to tzcode2013i i: The compile-time flag NOSOLAR has been removed, as nowadays the benefit of slightly shrinking runtime table size is outweighed by the cost of disallowing potential future updates that exceed old limits. h: Fix localtime overflow bugs with 32-bit unsigned time_t.
zdump no longer assumes sscanf returns maximal values on overflow. g: 'zic' now runs on platforms that lack both hard links and symlinks. (Thanks to Theo Veenker for reporting the problem, for MinGW.) Also, fix some bugs on platforms that lack hard links but have symlinks.
'zic -v' again warns that Asia/Tehran has no POSIX environment variable to predict the far future, fixing a bug introduced in 2013e. f: The types of the global variables 'timezone' and 'altzone' (if present) have been changed back to 'long'. This is required for 'timezone' by POSIX, and for 'altzone' by common practice, e.g., Solaris 11. These variables were originally 'long' in the tz code, but were mistakenly changed to 'time_t' in 1987; nobody reported the incompatibility until now. The difference matters on x32, where 'long' is 32 bits and 'time_t' is 64. (Thanks to Elliott Hughes.)
|
1.29 |
| 20-Sep-2013 |
christos | Welcome to tzcode 2013e:
Changes affecting API
The 'zic' command now outputs a dummy transition when far-future data can't be summarized using a TZ string, and uses a 402-year window rather than a 400-year window. For the current data, this affects only the Asia/Tehran file. It does not affect any of the time stamps that this file represents, so zdump outputs the same information as before. (Thanks to Andrew Main (Zefram).)
The 'date' command has a new '-r' option, which lets you specify the integer time to display, a la FreeBSD.
The 'tzselect' command has two new options '-c' and '-n', which lets you select a zone based on latitude and longitude.
The 'zic' command's '-v' option now warns about constructs that require the new version-3 binary file format. (Thanks to Arthur David Olson for the suggestion.)
Support for floating-point time_t has been removed. It was always dicey, and POSIX no longer requires it. (Thanks to Eric Blake for suggesting to the POSIX committee to remove it, and thanks to Alan Barrett, Clive D.W. Feather, Andy Heninger, Arthur David Olson, and Alois Treindl, for reporting bugs and elucidating some of the corners of the old floating-point implementation.)
The signatures of 'offtime', 'timeoff', and 'gtime' have been changed back to the old practice of using 'long' to represent UT offsets. This had been inadvertently and mistakenly changed to 'int_fast32_t'. (Thanks to Christos Zoulos.)
The code avoids undefined behavior on integer overflow in some more places, including gmtime, localtime, mktime and zdump.
Changes affecting the zdump utility
zdump now outputs "UT" when referring to Universal Time, not "UTC". "UTC" does not make sense for time stamps that predate the introduction of UTC, whereas "UT", a more-generic term, does. (Thanks to Steve Allen for clarifying UT vs UTC.)
Data changes affecting behavior of tzselect and similar programs
Country code BQ is now called the more-common name "Caribbean Netherlands" rather than the more-official "Bonaire, St Eustatius & Saba".
Remove from zone.tab the names America/Montreal, America/Shiprock, and Antarctica/South_Pole, as they are equivalent to existing same-country-code zones for post-1970 time stamps. The data for these names are unchanged, so the names continue to work as before.
Changes affecting code internals
zic -c now runs way faster on 64-bit hosts when given large numbers.
zic now uses vfprintf to avoid allocating and freeing some memory.
tzselect now computes the list of continents from the data, rather than have it hard-coded.
Minor changes pacify GCC 4.7.3 and GCC 4.8.1.
Changes affecting the build procedure
The 'leapseconds' file is now generated automatically from a new file 'leap-seconds.list', which is a copy of <ftp://time.nist.gov/pub/leap-seconds.list>. A new source file 'leapseconds.awk' implements this. The goal is simplification of the future maintenance of 'leapseconds'.
When building the 'posix' or 'right' subdirectories, if the subdirectory would be a copy of the default subdirectory, it is now made a symbolic link if that is supported. This saves about 2 MB of file system space.
The links America/Shiprock and Antarctica/South_Pole have been moved to the 'backward' file. This affects only nondefault builds that omit 'backward'.
Changes affecting documentation and commentary
Changes to the 'tzfile' man page
It now mentions that the binary file format may be extended in future versions by appending data.
It now refers to the 'zdump' and 'zic' man pages.
Changes to the 'zic' man page
It lists conditions that elicit a warning with '-v'.
It says that the behavior is unspecified when duplicate names are given, or if the source of one link is the target of another.
Its examples are updated to match the latest data.
The definition of white space has been clarified slightly. (Thanks to Michael Deckers.)
Changes to the 'Theory' file
There is a new section about the accuracy of the tz database, describing the many ways that errors can creep in, and explaining why so many of the pre-1970 time stamps are wrong or misleading (thanks to Steve Allen, Lester Caine, and Garrett Wollman for discussions that contributed to this).
The 'Theory' file describes LMT better (this follows a suggestion by Guy Harris).
It refers to the 2013 edition of POSIX rather than the 2004 edition.
It's mentioned that excluding 'backward' should not affect the other data, and it suggests at least one zone.tab name per inhabited country (thanks to Stephen Colebourne).
Some longstanding restrictions on names are documented, e.g., 'America/New_York' precludes 'America/New_York/Bronx'.
It gives more reasons for the 1970 cutoff.
It now mentions which time_t variants are supported, such as signed integer time_t. (Thanks to Paul Goyette for reporting typos in an experimental version of this change.)
(Thanks to Philip Newton for correcting typos in these changes.)
Documentation and commentary is more careful to distinguish UT in general from UTC in particular. (Thanks to Steve Allen.)
Add a better source for the Zurich 1894 transition. (Thanks to Pierre-Yves Berger.)
Update shapefile citations in tz-link.htm. (Thanks to Guy Harris.)
|
1.28 |
| 17-Jul-2013 |
christos | remove "register" in new code fix backwards check for overflow
|
1.27 |
| 17-Jul-2013 |
christos | welcome to 2013d
|
1.26 |
| 17-May-2013 |
joerg | branches: 1.26.2; Provide explicit LC_C_LOCALE accessor and drop the various NULL checks. Provide LC_GLOBAL_LOCALE in a way that works with all locale functions. Merge constant data used by the initial global locale and the C locale. Drop function call layer for _current_locale() and directly return the locale reference, not a pointer to it. Use protected access for global variables, so that libc references can avoid the GOT overhead.
|
1.25 |
| 21-Apr-2013 |
joerg | Store time-specific locale data directly in the locale. Ad dstrftime_l, strftime_lz and strptime_l.
|
1.24 |
| 02-Mar-2013 |
christos | update to tzcode2013a
|
1.23 |
| 24-Oct-2012 |
christos | apply 2012g via patch
|
1.22 |
| 20-Mar-2012 |
matt | branches: 1.22.2; Remove use of __P Switch to using C89 definitions.
|
1.21 |
| 16-Dec-2010 |
christos | branches: 1.21.6; Provide a re-entrant and thread-safe set of timezone API's that don't require locking and can operate on user-specified timezones as opposed to having to alter the environment to change a timezone. This work was presented to the tzcode folks and it was generally accepted, but there seems to be a lot of inertia.
|
1.20 |
| 31-Dec-2009 |
mlelstv | Import tzcode2009k. - now understands 64bit time_t and 64bit data in timezone files. - localtime(), gmtime(), asctime() and ctime() may now fail with a NULL result if time_t cannot be represented by struct tm.
|
1.19 |
| 11-Jan-2009 |
christos | merge christos-time_t
|
1.18 |
| 31-Jul-2007 |
ginsbach | branches: 1.18.14; 1.18.18; Make sure that %r honors the LC_TIME t_fmt_ampm. This restores functionality lost at revision 1.12!
|
1.17 |
| 22-Mar-2006 |
christos | branches: 1.17.4; 1.17.6; Coverity CID 580: fix 'c' handling to match 'x' ('c' used the wrong variable)
|
1.16 |
| 12-May-2004 |
kleink | Don't use tm_gmtoff for %z: a strictly conforming ISO C application won't initialize it. However, instead of using what is suggested in this code path, attempt get it right for DST as well. Addresses PR standards/21722 from Richard Earnshaw.
|
1.15 |
| 11-May-2004 |
kleink | Don't use tm_zone for %Z: a strictly conforming ISO C application won't initialize it. Addresses PR standards/21722 from Richard Earnshaw.
|
1.14 |
| 02-Oct-2002 |
itojun | branches: 1.14.2; license clarification, from openbsd
|
1.13 |
| 29-Jan-2002 |
kleink | branches: 1.13.2; Merge tzcode2002b.
|
1.12 |
| 12-Dec-2000 |
kleink | branches: 1.12.2; Merge strftime from tzcode2000g.
|
1.11 |
| 07-Sep-2000 |
taca | - Fix strftime(3) not to ignore tm_zone filed of last parameter, and "%Z" in format string is converted as proper time zone. This was taken from tzcode2000f. Fix PR lib/10950.
|
1.10 |
| 15-Jan-2000 |
kleink | branches: 1.10.4; Add the C99 %F conversion.
|
1.9 |
| 05-Nov-1999 |
erh | branches: 1.9.2; PR 5057 - fix %k to print a 0, not just spaces. (%e too). Patch from NAKAJIMA Yoshihiro.
|
1.8 |
| 07-Feb-1999 |
augustss | branches: 1.8.2; 1.8.4; Compute week number right. Fixes PR 6961, from Wolfgang Helbig <helbig@Informatik.BA-Stuttgart.DE>
|
1.7 |
| 01-Dec-1998 |
sommerfe | Fix pr6517: strftime %s returns unterminated string
|
1.6 |
| 15-Nov-1998 |
christos | delint
|
1.5 |
| 27-Sep-1998 |
kleink | Frob internal state keeping to make strftime() reentrant.
|
1.4 |
| 21-Jul-1997 |
jtc | If port provides __weak_alias(), provide an Standard C and POSIX pure identifier namespace by renaming non standard functions and variables such that they have a leading underscore. The library will use those names internally. Weak aliases are used to provide the original names to the API.
This is only the first part of this change. It is most of the functions which are implemented in C for all NetBSD ports. Subsequent changes are to add the same support to the remaining C files, to assembly files, and to the automagically generated assembly source used for system calls. When all of the above is done, ports with weak alias support should add a definition for __weak_alias to <sys/cdefs.h>.
|
1.3 |
| 13-Jul-1997 |
christos | Fix RCSID's
|
1.2 |
| 29-Apr-1997 |
kleink | * POSIX: use tzname for the %Z conversion, not tm->tm_zone. * KNF, RCSid police.
|
1.1 |
| 23-Apr-1997 |
mrg | branches: 1.1.1; move str[fp]time into libc/time.
|
1.1.1.3 |
| 25-Oct-2009 |
mlelstv | import tzcode2009k
|
1.1.1.2 |
| 29-Jan-2002 |
kleink | Import tzcode2002b.
|
1.1.1.1 |
| 12-Dec-2000 |
kleink | Import strftime from tzcode2000g.
|
1.8.4.1 |
| 27-Dec-1999 |
wrstuden | Pull up to last week's -current.
|
1.8.2.2 |
| 20-Sep-2000 |
he | Pull up revisions 1.9-1.10 (requested by taca): Fix %k and %e to print a 0 for hour 0, not just spaces. Fixes PR#5057. Add the C99 %F conversion.
|
1.8.2.1 |
| 11-Sep-2000 |
he | Pull up revision 1.11 (requested by taca): Do not ignore tm_zone field of last parameter, and convert "%Z" in format as proper time zone. Fixes PR#10950.
|
1.9.2.2 |
| 05-Nov-1999 |
erh | PR 5057 - fix %k to print a 0, not just spaces. (%e too). Patch from NAKAJIMA Yoshihiro.
|
1.9.2.1 |
| 05-Nov-1999 |
erh | file strftime.c was added on branch comdex-fall-1999 on 1999-11-05 19:21:13 +0000
|
1.10.4.2 |
| 24-Dec-2001 |
he | Pull up revision 1.12 (via patch, requested by kleink): Switch to widely circulated tzcode (2000g) implementation; it implements C99 features.
|
1.10.4.1 |
| 07-Sep-2000 |
taca | pull up revs 1.10 and 1.11, approved by thorpej:
> - Fix strftime(3) not to ignore tm_zone filed of last parameter, > and "%Z" in format string is converted as proper time zone. > This was taken from tzcode2000f. Fix PR lib/10950.
|
1.12.2.3 |
| 18-Oct-2002 |
nathanw | Catch up to -current.
|
1.12.2.2 |
| 22-Mar-2002 |
nathanw | Catch up to -current.
|
1.12.2.1 |
| 08-Mar-2002 |
nathanw | Catch up to -current.
|
1.13.2.1 |
| 07-Dec-2002 |
he | Pull up revision 1.14 (requested by itojun in ticket #896): License / copyright clarifications.
|
1.14.2.2 |
| 17-May-2004 |
tron | Pull up revision 1.16 (requested by kleink in ticket #349): Don't use tm_gmtoff for %z: a strictly conforming ISO C application won't initialize it. However, instead of using what is suggested in this code path, attempt get it right for DST as well. Addresses PR standards/21722 from Richard Earnshaw.
|
1.14.2.1 |
| 14-May-2004 |
jdc | Pull up revision 1.15 (requested by kleink in ticket #321).
Don't use tm_zone for %Z: a strictly conforming ISO C application won't initialize it. Addresses PR standards/21722 from Richard Earnshaw.
|
1.17.6.1 |
| 03-Sep-2007 |
wrstuden | Sync w/ NetBSD-4-RC_1
|
1.17.4.1 |
| 21-Aug-2007 |
liamjfoy | Pull up following revision(s) (requested by ginsbach in ticket #818): lib/libc/time/strftime.c: revision 1.18 Make sure that %r honors the LC_TIME t_fmt_ampm. This restores functionality lost at revision 1.12!
|
1.18.18.1 |
| 23-Nov-2008 |
christos | use %lld for time_t and snprintf instead of sprintf.
|
1.18.14.2 |
| 31-Jul-2007 |
ginsbach | Make sure that %r honors the LC_TIME t_fmt_ampm. This restores functionality lost at revision 1.12!
|
1.18.14.1 |
| 31-Jul-2007 |
ginsbach | file strftime.c was added on branch matt-mips64 on 2007-07-31 20:19:17 +0000
|
1.21.6.3 |
| 22-May-2014 |
yamt | sync with head.
for a reference, the tree before this commit was tagged as yamt-pagecache-tag8.
this commit was splitted into small chunks to avoid a limitation of cvs. ("Protocol error: too many arguments")
|
1.21.6.2 |
| 30-Oct-2012 |
yamt | sync with head
|
1.21.6.1 |
| 17-Apr-2012 |
yamt | sync with head
|
1.22.2.3 |
| 20-Aug-2014 |
tls | Rebase to HEAD as of a few days ago.
|
1.22.2.2 |
| 23-Jun-2013 |
tls | resync from head
|
1.22.2.1 |
| 20-Nov-2012 |
tls | Resync to 2012-11-19 00:00:00 UTC
|
1.26.2.1 |
| 23-Jul-2013 |
riastradh | sync with HEAD
|
1.30.4.1 |
| 25-Jan-2015 |
martin | Pull up the following revisions via patch, requested by apb in ticket #453:
doc/3RDPARTY up to 1.1195 usr.sbin/zdump/Makefile up to 1.9 usr.sbin/zic/Makefile up to 1.15 lib/libc/time/Makefile up to 1.25 lib/libc/time/Makefile.inc up to 1.21 lib/libc/time/NEWS up to 1.8 lib/libc/time/README up to 1.9 lib/libc/time/Theory up to 1.16 lib/libc/time/asctime.c up to 1.20 lib/libc/time/checktab.awk up to 1.8 lib/libc/time/ctime.3 up to 1.51 lib/libc/time/getdate.c up to 1.3 lib/libc/time/localtime.c up to 1.92 lib/libc/time/private.h up to 1.38 lib/libc/time/strftime.c up to 1.33 lib/libc/time/time2posix.3 up to 1.19 lib/libc/time/tz-art.htm up to 1.8 lib/libc/time/tz-link.htm up to 1.20 lib/libc/time/tzfile.5 up to 1.22 lib/libc/time/tzfile.h up to 1.16 lib/libc/time/tzselect.8 up to 1.6 lib/libc/time/tzselect.ksh up to 1.12 lib/libc/time/tzset.3 up to 1.31 lib/libc/time/zdump.8 up to 1.14 lib/libc/time/zdump.c up to 1.40 lib/libc/time/zic.8 up to 1.24 lib/libc/time/zic.c up to 1.52
Update tzcode from 2014e to 2014j.
|
1.36.2.2 |
| 20-Mar-2017 |
pgoyette | Sync with HEAD
|
1.36.2.1 |
| 04-Nov-2016 |
pgoyette | Sync with HEAD
|
1.38.2.1 |
| 21-Apr-2017 |
bouyer | Sync with HEAD
|
1.40.2.2 |
| 20-Oct-2018 |
pgoyette | Sync with head
|
1.40.2.1 |
| 21-May-2018 |
pgoyette | Sync with HEAD
|
1.41.2.1 |
| 10-Jun-2019 |
christos | Sync with HEAD
|