Module Name: src Committed By: christos Date: Sat Mar 2 21:24:28 UTC 2013
Modified Files: src/lib/libc/time: Makefile localtime.c strftime.c tz-art.htm tz-link.htm tzfile.5 tzselect.ksh zdump.c zic.c Log Message: update to tzcode2013a To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/lib/libc/time/Makefile \ src/lib/libc/time/tz-link.htm cvs rdiff -u -r1.72 -r1.73 src/lib/libc/time/localtime.c cvs rdiff -u -r1.23 -r1.24 src/lib/libc/time/strftime.c cvs rdiff -u -r1.3 -r1.4 src/lib/libc/time/tz-art.htm cvs rdiff -u -r1.18 -r1.19 src/lib/libc/time/tzfile.5 cvs rdiff -u -r1.7 -r1.8 src/lib/libc/time/tzselect.ksh cvs rdiff -u -r1.27 -r1.28 src/lib/libc/time/zdump.c cvs rdiff -u -r1.34 -r1.35 src/lib/libc/time/zic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libc/time/Makefile diff -u src/lib/libc/time/Makefile:1.8 src/lib/libc/time/Makefile:1.9 --- src/lib/libc/time/Makefile:1.8 Sun Oct 28 13:11:33 2012 +++ src/lib/libc/time/Makefile Sat Mar 2 16:24:28 2013 @@ -3,7 +3,10 @@ # 2009-05-17 by Arthur David Olson. # Version numbers of the code and data distributions. -VERSION = 2012h +VERSION = 2013a + +# Email address for bug reports. +BUGEMAIL= t...@iana.org # Change the line below for your time zone (after finding the zone you want in # the time zone files, or adding it to a time zone file). @@ -226,19 +229,25 @@ GCC_DEBUG_FLAGS = -Dlint -g3 -O3 -fno-co CFLAGS= -# If you want zic's -s option used when installing, uncomment the next line -# ZFLAGS= -s +# Linker flags. Default to $(LFLAGS) for backwards compatibility +# to tzcode2012h and earlier. + +LDFLAGS= $(LFLAGS) zic= ./zic ZIC= $(zic) $(ZFLAGS) # The name of a Posix-compliant `awk' on your system. -AWK= nawk +AWK= awk + +# The full path name of a Posix-compliant shell that supports the Korn shell's +# 'select' statement, as an extension. These days, Bash is the most popular. +KSHELL= /bin/bash # The path where SGML DTDs are kept. -# The default is appropriate for Ubuntu. -SGML_TOPDIR= /usr -SGML_SEARCH_PATH= $(SGML_TOPDIR)/share/xml/xhtml/schema/dtd/REC-html401-19991224 +# The default is appropriate for Ubuntu 12.10. +SGML_DTDDIR= $(SGML_TOPDIR)/share/xml/w3c-sgml-lib/schema/dtd +SGML_SEARCH_PATH= $(SGML_DTDDIR)/REC-html401-19991224 # The catalog file(s) to use when validating. SGML_CATALOG_FILES= HTML4.cat @@ -254,6 +263,17 @@ VALIDATE_ENV = \ SP_CHARSET_FIXED=YES \ SP_ENCODING=UTF-8 +# INVALID_CHAR is a regular expression that matches invalid characters in +# distributed files. For now, stick to a safe subset of ASCII. +# The caller must set the shell variable 'sharp' to the character '#', +# since Makefile macros cannot contain '#'. +# TAB_CHAR is a single tab character, in single quotes. +TAB_CHAR= ' ' +INVALID_CHAR1= $(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@' +INVALID_CHAR2= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`' +INVALID_CHAR3= 'abcdefghijklmnopqrstuvwxyz{|}~' +INVALID_CHAR= '[^]'$(INVALID_CHAR1)$(INVALID_CHAR2)$(INVALID_CHAR3)'-]' + # Flags to give 'tar' when making a distribution. # Try to use flags appropriate for GNU tar. GNUTARFLAGS= --numeric-owner --owner=0 --group=0 --mode=go+u,go-w @@ -336,14 +356,15 @@ INSTALL: ALL install date.1 cp date.1 $(MANDIR)/man1/. version.h: - echo >$@ \ - 'static char const TZVERSION[]="tz$(VERSION)";' + (echo 'static char const PKGVERSION[]="($(PACKAGE)) ";' && \ + echo 'static char const TZVERSION[]="$(VERSION)";' && \ + echo 'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";') >$@ zdump: $(TZDOBJS) - $(CC) $(CFLAGS) $(LFLAGS) $(TZDOBJS) $(LDLIBS) -o $@ + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS) zic: $(TZCOBJS) yearistype - $(CC) $(CFLAGS) $(LFLAGS) $(TZCOBJS) $(LDLIBS) -o $@ + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS) yearistype: yearistype.sh cp yearistype.sh yearistype @@ -378,22 +399,27 @@ zones: $(REDO) $(TZLIB): $(LIBOBJS) -mkdir $(TOPDIR) $(LIBDIR) ar ru $@ $(LIBOBJS) - if [ -x /usr/ucb/ranlib -o -x /usr/bin/ranlib ] ; \ + if [ -x /usr/ucb/ranlib ] || [ -x /usr/bin/ranlib ]; \ then ranlib $@ ; fi date: $(DATEOBJS) - $(CC) $(CFLAGS) date.o localtime.o asctime.o strftime.o \ - $(LDLIBS) -lc -o $@ + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS) tzselect: tzselect.ksh sed \ + -e 's|#!/bin/bash|#!$(KSHELL)|g' \ -e 's|AWK=[^}]*|AWK=$(AWK)|g' \ + -e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \ + -e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \ -e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \ - -e 's|\(TZVERSION\)=.*|\1=tz$(VERSION)|' \ + -e 's|\(TZVERSION\)=.*|\1=$(VERSION)|' \ <$? >$@ chmod +x $@ -check: check_tables check_web +check: check_character_set check_tables check_web + +check_character_set: $(ENCHILADA) + sharp='#'; ! grep -n $(INVALID_CHAR) $(ENCHILADA) check_tables: checktab.awk $(PRIMARY_YDATA) $(AWK) -f checktab.awk $(PRIMARY_YDATA) @@ -404,15 +430,18 @@ check_web: $(WEB_PAGES) clean: rm -f core *.o *.out \ date tzselect version.h zdump zic yearistype + rm -f -r tzpublic maintainer-clean: clean @echo 'This command is intended for maintainers to use; it' @echo 'deletes files that may need special tools to rebuild.' - rm -f *.[1-8].txt tzcode*.tar.gz tzdata*.tar.gz + rm -f *.[1-8].txt *.asc *.tar.gz names: @echo $(ENCHILADA) +public: check check_public set-timestamps tarballs signatures + # Set the time stamps to those of the git repository, if available, # and if the files have not changed since then. # This uses GNU 'touch' syntax 'touch -d@N FILE', @@ -432,14 +461,19 @@ set-timestamps: # The zics below ensure that each data file can stand on its own. # We also do an all-files run to catch links to links. -public: $(ENCHILADA) set-timestamps +check_public: $(ENCHILADA) make maintainer-clean make "CFLAGS=$(GCC_DEBUG_FLAGS)" - mkdir -m go-rwx /tmp/,tzpublic - -for i in $(TDATA) ; do zic -v -d /tmp/,tzpublic $$i 2>&1 | grep -v "starting year" ; done - for i in $(TDATA) ; do zic -d /tmp/,tzpublic $$i || exit; done - zic -v -d /tmp/,tzpublic $(TDATA) || exit - rm -f -r /tmp/,tzpublic + mkdir tzpublic + for i in $(TDATA) ; do \ + $(zic) -v -d tzpublic $$i 2>&1 || exit; \ + done + $(zic) -v -d tzpublic $(TDATA) + rm -f -r tzpublic + +tarballs: tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz + +tzcode$(VERSION).tar.gz: $(COMMON) $(DOCS) $(SOURCES) $(MISC) for i in *.[1-8] ; do \ LC_ALL=C sh workman.sh $$i > $$i.txt && \ touch -r $$i $$i.txt || exit; \ @@ -451,7 +485,15 @@ public: $(ENCHILADA) set-timestamps gzip $(GZIPFLAGS) > tzcode$(VERSION).tar.gz LC_ALL=C && export LC_ALL && \ tar $(TARFLAGS) -cf - $(COMMON) $(DATA) | \ - gzip $(GZIPFLAGS) > tzdata$(VERSION).tar.gz + gzip $(GZIPFLAGS) > $@ + +signatures: tzcode$(VERSION).tar.gz.asc tzdata$(VERSION).tar.gz.asc + +tzcode$(VERSION).tar.gz.asc: tzcode$(VERSION).tar.gz + gpg --armor --detach-sign $? + +tzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz + gpg --armor --detach-sign $? typecheck: make clean Index: src/lib/libc/time/tz-link.htm diff -u src/lib/libc/time/tz-link.htm:1.8 src/lib/libc/time/tz-link.htm:1.9 --- src/lib/libc/time/tz-link.htm:1.8 Thu Aug 9 08:38:25 2012 +++ src/lib/libc/time/tz-link.htm Sat Mar 2 16:24:28 2013 @@ -8,10 +8,11 @@ <meta http-equiv="Content-type" content='text/html; charset="US-ASCII"'> <meta name="DC.Creator" content="Eggert, Paul"> <meta name="DC.Contributor" content="Olson, Arthur David"> -<meta name="DC.Date" content="2012-07-19"> +<meta name="DC.Date" content="2013-02-21"> <meta name="DC.Description" content="Sources of information about time zones and daylight saving time"> -<meta name="DC.Identifier" content="http://www.twinsun.com/tz/tz-link.htm"> +<meta name="DC.Identifier" + content="http://www.iana.org/time-zones/repository/tz-link.htm"> <meta name="Keywords" content="database,daylight saving,DST,time zone,timezone,tz,zoneinfo"> </head> @@ -105,8 +106,14 @@ gzip -dc tzdata-latest.tar.gz | tar -xf </code></pre> <p> The code and data files can also be obtained from the -<a href="http://www.iana.org">IANA</a> -<a href="http://www.iana.org/time-zones">timezone web page</a>. +<a href="http://www.iana.org/time-zones">Time Zone Database website</a> +of the <a href="http://www.iana.org">Internet Assigned Numbers +Authority (IANA)</a>. +An <a href="https://github.com/eggert/tz">unofficial development +repository</a> of the code and data is available +in <a href="http://git-scm.com/">Git</a> form +from <a href="https://github.com/">GitHub</a>; be careful, as this +repository is less well tested and probably contains more errors. <p> The code lets you compile the <code>tz</code> source files into machine-readable binary files, one for each location. It also lets @@ -118,43 +125,35 @@ send changes to the <a href="mailto:tz@i mailing list</a>. You can also <a href="http://news.gmane.org/gmane.comp.time.tz">browse recent messages</a> sent to the mailing list, <a -href="https://mm.icann.org/mailman/listinfo/tz">subscribe</a> to it. -browse the <a +href="https://mm.icann.org/mailman/listinfo/tz">subscribe</a> to it, +and browse the <a href="http://mm.icann.org/pipermail/tz/">archive of old -messages</a> (message by message or in gzip compressed format), -or retrieve <a -href="ftp://ftp.iana.org/tz/releases/">archived older versions of code -and data</a>.</p> ++messages</a>.</p> <p> The Web has several other sources for time zone and daylight saving time data. -Here are some recent links that may be of interest. +Here are some links that may be of interest. </p> -<h2>Web pages using recent versions of the <code>tz</code> database</h2> +<h2>Web sites using recent versions of the <code>tz</code> database</h2> <p> These are listed roughly in ascending order of complexity and fanciness. </p> <ul> -<li> -<a href="http://permatime.com"> -Permatime</a> -is a service for generating and viewing links that refer to a -particular point in time and can be displayed in multiple timezones. -It uses the ruby tzinfo gem. -(From Tim Diggins, 2009-11-03.) -</li> <li><a href="http://twiki.org/cgi-bin/xtra/tzdatepick.html">Date and Time Gateway</a> lets you see the <code>TZ</code> values directly.</li> <li><a href="http://convertit.com/Go/ConvertIt/World_Time/Current_Time.ASP">Current Time in 1000 Places</a> uses descriptions of the values.</li> -<li><a href="http://www.timezoneconverter.com/">Time Zone Converter</a> +<li><a href="http://www.timezoneconverter.com/cgi-bin/tzc.tzc">Time Zone Converter</a> uses a pulldown menu.</li> <li><a href="http://home.tiscali.nl/~t876506/TZworld.html">Complete timezone information for all countries</a> displays tables of DST rules. -<li><a href="http://timeanddate.com/worldclock/">The World Clock - +<li><a href="http://timeanddate.com/worldclock/">The World Clock – Time Zones</a> lets you sort zone names and convert times.</li> -<li><a href="http://daylight-savings-time.info/">Graphical Display of -Time Zones and Daylight Saving Times</a> shows a graph of time +<li><a href="http://permatime.com/">Permatime</a> generates and views +links that refer to a particular point in time and can be displayed in +multiple timezones.</li> +<li><a href="http://daylight-savings-time.info/">Daylight Saving Time info</a> ++shows a graph of time difference versus time for any pair of locations.</li> <li>The <a href="http://worldtimeengine.com/">World Time Engine</a> also contains data about time zone boundaries; it supports queries via place @@ -175,7 +174,7 @@ Calendaring and Scheduling Working Group title="Calendaring and Scheduling Working Group">calsch</abbr>)</a> covers time zone data; see its VTIMEZONE calendar component. -The <a href="http://calconnect.org/">Calendaring and Scheduling +<a href="http://calconnect.org/">CalConnect, The Calendaring and Scheduling Consortium</a> is promoting further work in this area. <a href="http://calconnect.org/publications/icalendartimezoneproblemsandrecommendationsv1.0.pdf">iCalendar TIMEZONE Problems and Recommendations</a> offers guidelines and @@ -203,7 +202,7 @@ href="http://www.w3.org/2000/01/foo">sch </ul> <h2>Other <code>tz</code> compilers</h2> <ul> -<li><a href="http://www.dachaplin.dsl.pipex.com/vzic/">Vzic iCalendar +<li><a href="http://sourceforge.net/projects/vzic/">Vzic iCalendar Timezone Converter</a> describes a <a href="http://en.wikipedia.org/wiki/C_%28programming_language%29">C</a> program that compiles @@ -240,6 +239,10 @@ contains a class <code>org.joda.time.tz.ZoneInfoCompiler</code> that compiles <code>tz</code> source into a Joda-specific binary format. Joda Time is freely available under a <abbr>BSD</abbr>-style license.</li> +<li><a href="http://www.relativedata.com/time-zone-master">Time Zone +Master</a> is a Microsoft Windows clock program that can automatically +download, compile and use the <code>tzdata<var>D</var>.tar.gz</code> +files as they are released. The Basic version is free.</li> <li><a href="http://pytz.sourceforge.net">PyTZ - Python Time Zone Library</a> compiles <code>tz</code> source into <a href="http://python.org/">Python</a>. @@ -250,9 +253,9 @@ compiles <code>tz</code> source into It is freely available under the <abbr title="Massachusetts Institute of Technology">MIT</abbr> license.</li> <li>The <a href="http://chronos-st.org/">Chronos Date/Time -Library</a> is a <a href="http://smalltalk.org">Smalltalk</a> class -library that compiles <code>tz</code> source into a <a -href="http://date-time-zone.com/">time zone repository</a> whose format +Library</a> is +a <a href="http://en.wikipedia.org/wiki/Smalltalk">Smalltalk</a> class +library that compiles <code>tz</code> source into a time zone repository whose format is either proprietary or an <a href="http://www.w3.org/XML/"><abbr title="Extensible Markup Language">XML</abbr></a>-encoded representation.</li> @@ -268,6 +271,12 @@ DateTime::TimeZone::Tzfile</a> is a <code>tz</code> binary file reader written in Perl. It is freely available under the same terms as Perl (dual <abbr>GPL</abbr> and Artistic license).</li> +<li>The +public-domain <a href="https://github.com/dbaron/tz.js">tz.js</a> +library contains a Python tool that converts <code>tz</code> binary data into +<a href="http://www.json.org/">JSON</a>-format data suitable for use +in its <a href="http://en.wikipedia.org/wiki/JavaScript">JavaScript</a> library for time zone conversion. Dates before 1970 +are not supported.</li> <ul> <li>The <a href="http://www.gnu.org/software/libc/"><abbr>GNU</abbr> C @@ -287,14 +296,13 @@ It is freely available under the <abbr>L </ul> <h2>Other <code>tz</code>-based time zone software</h2> <ul> -<li><a href="http://stemhaus.com/firefox/foxclocks/">FoxClocks</a> -is an extension for <a +<li><a href="http://foxclocks.org/">FoxClocks</a> +is an extension for <a href="http://google.com/chrome">Google +Chrome</a> and for <a href="http://developer.mozilla.org/en/docs/Toolkit_API">Mozilla Toolkit</a> applications like <a -href="http://mozilla.com/firefox">Firefox</a>, <a -href="http://mozilla.com/thunderbird">Thunderbird</a>, and -<a -href="http://www.mozilla.org/projects/calendar/sunbird/">Sunbird</a>. +href="http://mozilla.com/firefox">Firefox</a> and <a +href="http://mozilla.com/thunderbird">Thunderbird</a>. It displays multiple clocks in the application window, and has a mapping interface to <a href="http://earth.google.com/">Google Earth</a>. It is freely available under the <abbr>GPL</abbr>.</li> @@ -303,13 +311,8 @@ href="http://users.skynet.be/Peter.Verth clock (intclock)</a> is a multi-timezone clock for <abbr>GNU</abbr>/Linux and similar systems. It is freely available under the <abbr>GPL</abbr>.</li> -<li><a href="http://codeplex.com/publicdomain">PublicDomain</a> -has a copy of a recent <code>tz</code> database, accessed via a <a -href="http://en.wikipedia.org/wiki/C_Sharp">C#</a> library. As its -name suggests, it is in the public domain. Only current time stamps -are well supported; historical data are compiled into the runtime but -are not easily accessible.</li> -<li><a href="http://java.sun.com/">Sun Java</a> releases since 1.4 +<li><a href="http://www.oracle.com/us/technologies/java/overview/index.html">Oracle +Java</a> releases since 1.4 contain a copy of a subset of a recent <code>tz</code> database in a Java-specific format.</li> <li><a href="http://kimmo.suominen.com/sw/timezone/">Time Zone</a> is @@ -323,36 +326,19 @@ licenses</a> to <code>tz</code> contribu <li><a href="http://worldtimeexplorer.com/">World Time Explorer</a> is a Microsoft Windows program.</li> -<li> -<a href="http://www.toriasoft.com"> -WorldClock for Windows and Windows Mobile</a> -lets users "see the time in up to 25 locations in the world at once." -(From Hans Nieuwenhuis, 2009-11-02.) -</li> -<li> -<a href="http://www.relativedata.com/time-zone-master"> -Time Zone Master Basic -</a> "allows people to display multiple desktop clocks, and to -research current and historical time information, as well as times of -astronomical events (sunrise/transit/set, moonrise/transit/set, phases, -season starts) for user-selected dates in the past and future. It can -automatically download, compile and use the tzdata**.gz database files -as they are released to keep the data up to date. The software is -free." (Davie Patte) -</li> </ul> <h2>Other time zone databases</h2> <ul> <li><a href="http://www.astro.com/cgi/aq.cgi">Atlas Query</a> -is Astrodienst's Web version of Shanks's -excellent time zone history atlases published in both <a -href="http://astrocom.com/products/software.php?software_id=ibmwboth">computer</a> +is Astrodienst's Web version of Shanks and Pottenger's +time zone history atlases published in both <a +href="http://astrocom.com/astrology-products/software/acs-atlas-software">computer</a> and book form (<a -href="http://astrocom.com/products/book.php?book_id=b110x">one volume +href="http://www.astrocom.com/astrology/books/american-atlas">one volume for the USA</a>, and <a -href="http://astrocom.com/products/book.php?book_id=b112x">one for +href="http://www.astrocom.com/astrology/books/international-atlas">one for other locations</a>) by <a -href="http://astrocom.com/">Astro Communications Services</a>.</li> +href="http://astrocom.com/">Astro Computing Services</a>.</li> <li><a href="http://worldtime.com/">WORLDTIME: interactive atlas, time info, public holidays</a> contains information on local time, sunrise and sunset, @@ -363,7 +349,7 @@ is another time zone database.</li> contains data from the Time Service Department of the <abbr>US</abbr> Naval Observatory, used as the source for the <code>usno*</code> files in the <code>tz</code> distribution.</li> -<li>The <a href="http://iata.org/ps/publications/SSIM.htm">Standard +<li>The <a href="http://www.iata.org/publications/Pages/ssim.aspx">Standard Schedules Information Manual</a> of the <a href="http://iata.org/index.htm">International Air Transport Association</a> @@ -371,28 +357,17 @@ gives current time zone rules for airpor <li>Some Microsoft Windows versions contain time zone information in an undocumented format, with IDs that can be mapped to <code>TZ</code> values using the <a -href="http://unicode.org/cldr/data/diff/supplemental/windows_tzid.html">Windows +href="http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/zone_tzid.html">Zone → Tzid table</a> maintained by the <abbr title="Common Locale Data Repository">CLDR</abbr> data mentioned below.</li> -<li> -<a href="http://code.google.com/p/tzdata/"> -http://code.google.com/p/tzdata/ -</a> -provides programming-language-specific representations of timezone -data. Currently this includes XML, PHP, Ruby, Javascript, JSON and CSV -formatted data. The repository is updated as soon as the FTP -distribution is updated. All data can be downloaded as a zip and/or it -can be obtained/synced via anonymous SVN. Data is made available under -the MIT license. (From Rich Tibbett.) -</li> </ul> <h2>Maps</h2> <ul> <li>The <a href="https://www.cia.gov/">United States Central Intelligence Agency (<abbr title="Central Intelligence Agency">CIA</abbr>)</a> publishes a <a -href="https://www.cia.gov/library/publications/the-world-factbook/reference_maps/pdf/time_zones.pdf">time +href="https://www.cia.gov/library/publications/the-world-factbook/graphics/ref_maps/physical/pdf/standard_time_zones_of_the_world.pdf">time zone map</a>; the <a href="http://www.lib.utexas.edu/maps/world.html">Perry-Castañeda @@ -421,8 +396,8 @@ of Countries ("Statoids")</a> contains d zone boundaries for multizone countries</a> summarizes legal boundaries between time zones within countries.</li> <li>Manifold.net's <a -href="http://www.manifold.net/download/freemaps.html">Free Maps and -<abbr title="Geographic Information Systems">GIS</abbr> +href="http://manifold.net/info/freestuff.shtml">Free Stuff for +Manifold System Users</a> includes a Manifold-format map of Data</a> includes a Manifold-format map of world time zone boundaries distributed under the <abbr>GPL</abbr>.</li> @@ -453,15 +428,15 @@ Saving Time - History, rationale, laws & is an overall history of <abbr>DST</abbr>.</li> <li><a href="http://energy.ca.gov/daylightsaving.html">Saving Time, Saving Energy</a> discusses a primary justification for <abbr>DST</abbr>.</li> -<li><a href="http://seizethedaylight.com/dst/">Who Knew? A Brief +<li><a href="http://seizethedaylight.com/dst/">A Brief History of Daylight Saving Time</a> summarizes some of the contentious history of <abbr>DST</abbr>.</li> -<li><a href="http://toi.iriti.cnr.it/">The +<li><a href="http://toi.inrim.it/uk/toi.html">The Time of Internet</a> describes time zones and daylight saving time, with diagrams. The time zone map is out of date, however.</li> -<li><a href="http://www.phys.uu.nl/~vgent/idl/idl.htm">A History of +<li><a href="http://www.staff.science.uu.nl/~gent0113/idl/idl.htm">A History of the International Date Line</a> tells the story of the most important time zone boundary.</li> <li><a href="http://statoids.com/tconcept.html">Basic Time @@ -471,7 +446,7 @@ Zone Concepts</a> discusses terminologic <dl> <dt>Australia</dt> <dd>The Parliamentary Library has commissioned <a -href="http://www.aph.gov.au/LIBRARY/Pubs/rn/2006-07/07rn13.pdf">research +href="http://www.aph.gov.au/binaries/library/pubs/rn/2006-07/07rn13.pdf">research note on daylight saving time in Australia</a>. The Bureau of Meteorology publishes a list of <a href="http://www.bom.gov.au/climate/averages/tables/dst_times.shtml">Implementation Dates of Daylight Savings Time within Australia</a>.</dd> @@ -485,17 +460,17 @@ records <a href="http://pcdsh01.on.br/De hreflang="pt-BR">Brazil's daylight saving time decrees (in Portuguese)</a>.</dd> <dt>Canada</dt> -<dd>The Institute for National Measurement Standards publishes current +<dd>National Research Council Canada publishes current and some older information about <a -href="http://inms-ienm.nrc-cnrc.gc.ca/time_services/daylight_saving_e.html">Time -Zones & Daylight Saving Time</a>.</dd> +href="http://www.nrc-cnrc.gc.ca/eng/services/time/time_zones.html">time +zones & daylight saving time</a>.</dd> <dt>Chile</dt> <dd>The Chilean Hydrographic and Oceanographic Service publishes a <a href="http://www.horaoficial.cl/horaof.htm" hreflang="es"> history of official time (in Spanish)</a>.</dd> <dt>Germany</dt> <dd>The National Institute for Science and Technology maintains the <a -href="http://www.ptb.de/en/org/4/44/441/dars_e.htm">Realisation of +href="http://www.ptb.de/cms/en/fachabteilungen/abt4/fb-44/ag-441/realisation-of-legal-time-in-germany.html">Realisation of Legal Time in Germany</a>.</dd> <dt>Israel</dt> <dd>The Interior Ministry periodically issues <a @@ -504,25 +479,20 @@ hreflang="he">announcements (in Hebrew)< <dt>Mexico</dt> <dd>The Investigation and Analysis Service of the Mexican Library of Congress has published a <a -href="http://www.cddhcu.gob.mx/bibliot/publica/inveyana/polisoc/horver/" +href="http://www.diputados.gob.mx/bibliot/publica/inveyana/polisoc/horver/" hreflang="es">history of Mexican local time (in Spanish)</a>.</dd> <dt>Malaysia</dt> <dd>See Singapore below.</dd> <dt>Netherlands</dt> -<dd><a href="http://www.phys.uu.nl/~vgent/wettijd/wettijd.htm" +<dd><a href="http://www.staff.science.uu.nl/~gent0113/wettijd/wettijd.htm" hreflang="nl">Legal time in the Netherlands (in Dutch)</a> covers the history of local time in the Netherlands from ancient times.</dd> <dt>New Zealand</dt> -<dd>The Department of Internal Affairs maintains a brief history <a -href="http://dia.govt.nz/diawebsite.nsf/wpg_URL/Resource-material-Information-We-Provide-About-Daylight-Saving">About +<dd>The Department of Internal Affairs maintains a brief <a +href="http://www.dia.govt.nz/Daylight-Saving-History">History of Daylight Saving</a>. The privately-maintained <a href="http://astrologyschool.com/nztime.html">History of New Zealand time</a> has more details.</dd> -<dt>Norway</dt> -<dd>The Norwegian Meteorological Institute lists -<a href="http://met.no/met/met_lex/q_u/sommertid.html" hreflang="no">Summer -time in Norway (in Norwegian)</a>, citing the -Institute of Theoretical Astrophysics, Oslo.</dd> <dt>Singapore</dt> <dd><a href="http://www.math.nus.edu.sg/aslaksen/teaching/timezone.html">Why @@ -530,11 +500,11 @@ is Singapore in the "Wrong" Time Zone?</ history of legal time in Singapore and Malaysia.</dd> <dt>United Kingdom</dt> <dd><a -href="http://www.srcf.ucam.org/~jsm28/british-time/">History of +href="http://www.polyomino.org.uk/british-time/">History of legal time in Britain</a> discusses in detail the country with perhaps the best-documented history of clock adjustments. The National Physical Laboratory also maintains an <a -href="http://www.npl.co.uk/server.php?show=ConWebDoc.2714">Archive +href="http://www.npl.co.uk/educate-explore/what-is-the-time/archive-of-summer-time-dates-1916-2006">Archive of Summer time dates</a>.</dd> </dl> <h2>Precision timekeeping</h2> @@ -553,7 +523,8 @@ href="ftp://ftp.rfc-editor.org/in-notes/ Options for <abbr title="Dynamic Host Configuration Protocol">DHCP</abbr></a> (Internet <abbr>RFC</abbr> 4833) specifies a <a -href="http://www.dhcp.org/">DHCP</a> option for a server to configure +href="http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol">DHCP</a> +option for a server to configure a client's time zone and daylight saving settings automatically.</li> <li><a href="http://gauss.gge.unb.ca/GMT.UT.and.the.RGO.html">A Few Facts Concerning <abbr title="Greenwich Mean Time">GMT</abbr>, <abbr @@ -571,14 +542,14 @@ Times</a> explains more abstruse astrono Scales</a> goes into more detail, particularly for historical variants.</li> <li>The <a href="http://iau.org/"><abbr title="International Astronomical Union">IAU</abbr></a>'s <a -href="http://www.iau-sofa.rl.ac.uk/"><abbr +href="http://www.iausofa.org/"><abbr title="Standards Of Fundamental Astronomy">SOFA</abbr></a> initiative publishes Fortran code for converting among time scales like <abbr title="International Atomic Time">TAI</abbr>, <abbr>TDB</abbr>, <abbr>TDT</abbr> and <abbr>UTC</abbr>.</li> -<li><a href="http://jpl.nasa.gov/basics/bsf2-3.htm">Basics of +<li><a href="http://www2.jpl.nasa.gov/basics/bsf2-3.php">Basics of Space Flight - Reference Systems - Time Conventions</a> briefly explains interplanetary space flight timekeeping.</li> <li><a @@ -593,13 +564,9 @@ dedicated not only to leap seconds but t in general. It covers the state of the art in amateur timekeeping, and how the art has progressed over the past few decades.</li> <li><a -href="http://hpiers.obspm.fr/eop-pc/products/bulletins/bulletins.html">Bulletins -maintained by the -<abbr title="International Earth Rotation Service">IERS</abbr> -<abbr title="Earth Orientation Parameters">EOP</abbr> -(<abbr title="Product Center">PC</abbr>)</a> contains official publications of -the Earth Orientation Parameters Product Center of the -International Earth Rotation Service, the committee that decides +href="http://www.iers.org/IERS/EN/Publications/Bulletins/bulletins.html">IERS +Bulletins</a> contains official publications of the International +Earth Rotation and Reference Systems Service, which decides when leap seconds occur.</li> <li>The <a href="http://six.pairlist.net/mailman/listinfo/leapsecs">Leap @@ -609,11 +576,8 @@ and Klepczynski's proposal to discontinu discussed further in <a href="http://www.cl.cam.ac.uk/~mgk25/time/metrologia-leapsecond.pdf">The leap second: its history and possible future</a>. -The (now disbanded) <a href="http://members.aas.org/comms/leap.cfm"><abbr -title="American Astronomical Society">AAS</abbr> Leap Second -Committee</a> has solicited input on this proposal. -<a href="http://www.ucolick.org/~sla/leapsecs/">The -Future of Leap Seconds</a> covers this +<a href="http://www.ucolick.org/~sla/leapsecs/">UTC might be redefined +without Leap Seconds</a> gives pointers on this contentious issue.</li> </ul> <h2>Time notation</h2> @@ -623,7 +587,7 @@ contentious issue.</li> the International Standard Date and Time Notation</a> is a good summary of <a -href="http://www.iso.org/iso/en/CatalogueDetailPage.CatalogueDetail?CSNUMBER=40874"><abbr +href="http://www.iso.org/iso/catalogue_detail?csnumber=40874"><abbr title="International Organization for Standardization">ISO</abbr> 8601:2004 -- Data elements and interchange formats -- Information interchange -- Representation of dates and times</a>.</li> @@ -658,8 +622,8 @@ abbreviations, identifiers, and formats. French translations for "Eastern European Summer Time", "<abbr title="Eastern European Summer Time">EEST</abbr>", and "Bucharest". <a -href="http://unicode.org/cldr/data/charts/by_type/names.metazone.html">By-Type -Chart: names.metazone</a> shows these values for many locales. +href="http://unicode.org/cldr/charts/by_type/index.html">By-Type +Chart</a> shows these values for many locales. <abbr>ICU</abbr> contains a mechanism for using this data.</li> <li>Alphabetic time zone abbreviations should not be used as unique identifiers for <abbr>UTC</abbr> offsets as they are ambiguous in @@ -693,8 +657,6 @@ is called "<abbr>GMT</abbr>".</li> <li><a href="tz-art.htm">Time and the Arts</a></li> <li><a href="http://www.dmoz.org/Reference/Time/">Open Directory - Reference: Time</a></li> -<li><a href="http://directory.google.com/Top/Reference/Time/">Google Directory -- Reference > Time</a></li> <li><a href="http://dir.yahoo.com/Science/Measurements_and_Units/Time">Yahoo! Directory > Science > Measurements and Units > Time</a></li> </ul> Index: src/lib/libc/time/localtime.c diff -u src/lib/libc/time/localtime.c:1.72 src/lib/libc/time/localtime.c:1.73 --- src/lib/libc/time/localtime.c:1.72 Sun Oct 28 15:02:29 2012 +++ src/lib/libc/time/localtime.c Sat Mar 2 16:24:28 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: localtime.c,v 1.72 2012/10/28 19:02:29 christos Exp $ */ +/* $NetBSD: localtime.c,v 1.73 2013/03/02 21:24:28 christos Exp $ */ /* ** This file is in the public domain, so clarified as of @@ -10,7 +10,7 @@ #if 0 static char elsieid[] = "@(#)localtime.c 8.17"; #else -__RCSID("$NetBSD: localtime.c,v 1.72 2012/10/28 19:02:29 christos Exp $"); +__RCSID("$NetBSD: localtime.c,v 1.73 2013/03/02 21:24:28 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -337,8 +337,7 @@ settzname(void) for (i = 0; i < sp->typecnt; ++i) { const struct ttinfo * const ttisp = &sp->ttis[i]; - tzname[ttisp->tt_isdst] = - &sp->chars[ttisp->tt_abbrind]; + tzname[ttisp->tt_isdst] = &sp->chars[ttisp->tt_abbrind]; #ifdef USG_COMPAT if (ttisp->tt_isdst) daylight = 1; @@ -523,20 +522,31 @@ tzload(timezone_t sp, const char *name, ** signed time_t system but using a data file with ** unsigned values (or vice versa). */ - for (i = 0; i < sp->timecnt - 2; ++i) - if (sp->ats[i] > sp->ats[i + 1]) { - ++i; + for (i = 0; i < sp->timecnt; ++i) + if ((i < sp->timecnt - 1 && + sp->ats[i] > sp->ats[i + 1]) || + (i == sp->timecnt - 1 && !TYPE_SIGNED(time_t) && + sp->ats[i] > + ((stored == 4) ? INT32_MAX : INT64_MAX))) { if (TYPE_SIGNED(time_t)) { /* ** Ignore the end (easy). */ - sp->timecnt = i; + sp->timecnt = i + 1; } else { /* ** Ignore the beginning (harder). */ int j; + /* + ** Keep the record right before the + ** epoch boundary, + ** but tweak it so that it starts + ** right with the epoch + ** (thanks to Doug Bailey). + */ + sp->ats[i] = 0; for (j = 0; j + i < sp->timecnt; ++j) { sp->ats[j] = sp->ats[j + i]; sp->types[j] = sp->types[j + i]; Index: src/lib/libc/time/strftime.c diff -u src/lib/libc/time/strftime.c:1.23 src/lib/libc/time/strftime.c:1.24 --- src/lib/libc/time/strftime.c:1.23 Tue Oct 23 20:10:03 2012 +++ src/lib/libc/time/strftime.c Sat Mar 2 16:24:28 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: strftime.c,v 1.23 2012/10/24 00:10:03 christos Exp $ */ +/* $NetBSD: strftime.c,v 1.24 2013/03/02 21:24:28 christos Exp $ */ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) @@ -6,14 +6,16 @@ static char elsieid[] = "@(#)strftime.c 7.64"; static char elsieid[] = "@(#)strftime.c 8.3"; #else -__RCSID("$NetBSD: strftime.c,v 1.23 2012/10/24 00:10:03 christos Exp $"); +__RCSID("$NetBSD: strftime.c,v 1.24 2013/03/02 21:24:28 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ #include "namespace.h" /* -** Based on the UCB version with the ID appearing below. +** Based on the UCB version with the copyright notice and sccsid +** appearing below. +** ** This is ANSIish only when "multibyte character == plain character". */ Index: src/lib/libc/time/tz-art.htm diff -u src/lib/libc/time/tz-art.htm:1.3 src/lib/libc/time/tz-art.htm:1.4 --- src/lib/libc/time/tz-art.htm:1.3 Thu Aug 9 08:38:25 2012 +++ src/lib/libc/time/tz-art.htm Sat Mar 2 16:24:28 2013 @@ -415,6 +415,13 @@ http://us.imdb.com/title/tt0137494/ </a>. (Mark Brader, 2009-10-02) </li> <li> +In the "Run by the Monkeys" episode of "Da Vinci's Inquest" +(first broadcast 2002-11-17), +a witness in a five-year-old fire case realizes they may not have set +their clock back when daylight saving ended on the day of the fire, +introducing the possibility of an hour when arson might have occurred. +</li> +<li> In "The Todd Couple" episode of "Outsourced" (first aired 2011-02-10), Manmeet sets up teledates for 6:00 and 9:00; since one is with a New Yorker and the other with a San Franciscan, Index: src/lib/libc/time/tzfile.5 diff -u src/lib/libc/time/tzfile.5:1.18 src/lib/libc/time/tzfile.5:1.19 --- src/lib/libc/time/tzfile.5:1.18 Thu Aug 9 08:38:25 2012 +++ src/lib/libc/time/tzfile.5 Sat Mar 2 16:24:28 2013 @@ -1,4 +1,4 @@ -.\" $NetBSD: tzfile.5,v 1.18 2012/08/09 12:38:25 christos Exp $ +.\" $NetBSD: tzfile.5,v 1.19 2013/03/02 21:24:28 christos Exp $ .\" .\" This file is in the public domain, so clarified as of .\" 1996-06-05 by Arthur David Olson (arthur_david_ol...@nih.gov). @@ -141,7 +141,7 @@ is zero or the time argument is less tha in the file. .Pp For version-2-format time zone files, -the above header and data is followed by a second header and data, +the above header and data are followed by a second header and data, identical in format except that eight bytes are used for each transition time or leap second time. After the second header and data comes a newline-enclosed, Index: src/lib/libc/time/tzselect.ksh diff -u src/lib/libc/time/tzselect.ksh:1.7 src/lib/libc/time/tzselect.ksh:1.8 --- src/lib/libc/time/tzselect.ksh:1.7 Thu Aug 9 08:38:26 2012 +++ src/lib/libc/time/tzselect.ksh Sat Mar 2 16:24:28 2013 @@ -1,8 +1,10 @@ -#! /bin/ksh +#! /bin/bash # -# $NetBSD: tzselect.ksh,v 1.7 2012/08/09 12:38:26 christos Exp $ +# $NetBSD: tzselect.ksh,v 1.8 2013/03/02 21:24:28 christos Exp $ # -VERSION=see_Makefile +PKGVERSION='(tzcode) ' +TZVERSION=see_Makefile +REPORT_BUGS_TO=t...@iana.org # Ask the user about the time zone, and output the resulting TZ value to stdout. # Interact with the user via stderr and stdin. @@ -11,29 +13,22 @@ VERSION=see_Makefile # Porting notes: # -# This script requires several features of the Korn shell. -# If your host lacks the Korn shell, -# you can use either of the following free programs instead: -# -# <a href=ftp://ftp.gnu.org/pub/gnu/> -# Bourne-Again shell (bash) -# </a> +# This script requires a Posix-like shell with the extension of a +# 'select' statement. The 'select' statement was introduced in the +# Korn shell and is available in Bash and other shell implementations. +# If your host lacks both Bash and the Korn shell, you can get their +# source from one of these locations: # -# <a href=ftp://ftp.cs.mun.ca/pub/pdksh/pdksh.tar.gz> -# Public domain ksh -# </a> +# Bash <http://www.gnu.org/software/bash/bash.html> +# Korn Shell <http://www.kornshell.com/> +# Public Domain Korn Shell <http://www.cs.mun.ca/~michael/pdksh/> # # This script also uses several features of modern awk programs. -# If your host lacks awk, or has an old awk that does not conform to Posix.2, +# If your host lacks awk, or has an old awk that does not conform to Posix, # you can use either of the following free programs instead: # -# <a href=ftp://ftp.gnu.org/pub/gnu/> -# GNU awk (gawk) -# </a> -# -# <a href=ftp://ftp.whidbey.net/pub/brennan/> -# mawk -# </a> +# Gawk (GNU awk) <http://www.gnu.org/software/gawk/> +# mawk <http://invisible-island.net/mawk/> # Specify default values for environment variables if they are unset. @@ -52,14 +47,14 @@ if [ "$1" = "--help" ]; then Usage: tzselect Select a time zone interactively. -Report bugs to t...@elsie.nci.nih.gov. +Report bugs to $REPORT_BUGS_TO. EOF - exit 0 + exit elif [ "$1" = "--version" ]; then cat <<EOF tzselect $TZVERSION EOF - exit 0 + exit fi # Make sure the tables are readable. Index: src/lib/libc/time/zdump.c diff -u src/lib/libc/time/zdump.c:1.27 src/lib/libc/time/zdump.c:1.28 --- src/lib/libc/time/zdump.c:1.27 Thu Jan 31 10:47:53 2013 +++ src/lib/libc/time/zdump.c Sat Mar 2 16:24:28 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: zdump.c,v 1.27 2013/01/31 15:47:53 christos Exp $ */ +/* $NetBSD: zdump.c,v 1.28 2013/03/02 21:24:28 christos Exp $ */ /* ** This file is in the public domain, so clarified as of ** 2009-05-17 by Arthur David Olson. @@ -6,7 +6,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: zdump.c,v 1.27 2013/01/31 15:47:53 christos Exp $"); +__RCSID("$NetBSD: zdump.c,v 1.28 2013/03/02 21:24:28 christos Exp $"); #endif /* !defined lint */ #include "version.h" @@ -254,8 +254,8 @@ usage(FILE *const stream, const int stat (void) fprintf(stream, _("%s: usage is %s [ --version ] [ --help ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n\ \n\ -Report bugs to t...@elsie.nci.nih.gov.\n"), - progname, progname); +Report bugs to %s.\n"), + progname, progname, REPORT_BUGS_TO); exit(status); } @@ -291,7 +291,7 @@ main(int argc, char *argv[]) progname = argv[0]; for (i = 1; i < argc; ++i) if (strcmp(argv[i], "--version") == 0) { - (void) printf("%s\n", TZVERSION); + (void) printf("zdump %s%s\n", PKGVERSION, TZVERSION); exit(EXIT_SUCCESS); } else if (strcmp(argv[i], "--help") == 0) { usage(stdout, EXIT_SUCCESS); Index: src/lib/libc/time/zic.c diff -u src/lib/libc/time/zic.c:1.34 src/lib/libc/time/zic.c:1.35 --- src/lib/libc/time/zic.c:1.34 Thu Oct 25 11:04:05 2012 +++ src/lib/libc/time/zic.c Sat Mar 2 16:24:28 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: zic.c,v 1.34 2012/10/25 15:04:05 martin Exp $ */ +/* $NetBSD: zic.c,v 1.35 2013/03/02 21:24:28 christos Exp $ */ /* ** This file is in the public domain, so clarified as of ** 2006-07-17 by Arthur David Olson. @@ -10,7 +10,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: zic.c,v 1.34 2012/10/25 15:04:05 martin Exp $"); +__RCSID("$NetBSD: zic.c,v 1.35 2013/03/02 21:24:28 christos Exp $"); #endif /* !defined lint */ #include "version.h" @@ -442,8 +442,8 @@ usage(FILE *stream, int status) [ --version ] [ --help ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n\ \t[ -d directory ] [ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n\ \n\ -Report bugs to t...@elsie.nci.nih.gov.\n"), - progname, progname); +Report bugs to %s.\n"), + progname, progname, REPORT_BUGS_TO); exit(status); } @@ -478,7 +478,7 @@ main(int argc, char *argv[]) } for (i = 1; i < argc; ++i) if (strcmp(argv[i], "--version") == 0) { - (void) printf("%s\n", TZVERSION); + (void) printf("zic %s%s\n", PKGVERSION, TZVERSION); exit(EXIT_SUCCESS); } else if (strcmp(argv[i], "--help") == 0) { usage(stdout, EXIT_SUCCESS); @@ -1761,7 +1761,7 @@ stringoffset(char *result, long offset) minutes = offset % MINSPERHOUR; offset /= MINSPERHOUR; hours = offset; - if (hours >= HOURSPERDAY) { + if (hours > HOURSPERDAY) { result[0] = '\0'; return -1; } @@ -1865,7 +1865,9 @@ stringzone(char *result, const int resul rp = &zp->z_rules[i]; if (stdrp == NULL || rp->r_hiyear > stdrp->r_hiyear || (rp->r_hiyear == stdrp->r_hiyear && - rp->r_month > stdrp->r_month)) + (rp->r_month > stdrp->r_month || + (rp->r_month == stdrp->r_month && + rp->r_dayofmonth > stdrp->r_dayofmonth)))) stdrp = rp; } if (stdrp != NULL && stdrp->r_stdoff != 0) @@ -2550,8 +2552,8 @@ newabbr(const char *const string) ++cp; if (cp - string == 0) mp = _("time zone abbreviation lacks alphabetic at start"); - if (noise && cp - string > 3) -mp = _("time zone abbreviation has more than 3 alphabetics"); + if (noise && cp - string < 3) +mp = _("time zone abbreviation has fewer than 3 alphabetics"); if (cp - string > ZIC_MAX_ABBR_LEN_WO_WARN) mp = _("time zone abbreviation has too many alphabetics"); if (mp == NULL && (*cp == '+' || *cp == '-')) {