Lines Matching +full:itu +full:- +full:r
1 # Generate zic format 'leapseconds' from NIST/IERS format 'leap-seconds.list'.
9 # POSIX-conforming awk implementations invariably use IEEE-754 double
23 print "# This file is generated automatically from the data in the public-domain"
24 print "# NIST/IERS format leap-seconds.list file, which can be copied from"
25 print "# <https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list>"
27 print "# <ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.list>."
28 print "# For more about leap-seconds.list, please see"
33 print "# Standard-frequency and time-signal emissions."
34 print "# International Telecommunication Union - Radiocommunication Sector"
35 print "# (ITU-R) Recommendation TF.460-6 (02/2002)"
36 print "# <https://www.itu.int/rec/R-REC-TF.460-6-200202-I/>."
43 print "# URSI Radio Sci Bull. 2016;89(4):30-6. doi:10.23919/URSIRSB.2016.7909995"
48 print "# rotation. The first (\"1 Jan 1972\") data line in leap-seconds.list"
52 print "# All leap-seconds are Stationary (S) at the given UTC time."
53 print "# The correction (+ or -) is made at the given time, so in the unlikely"
55 print "# Leap YEAR MON DAY 23:59:59 - S"
76 { sub(/\r$/, "") }
94 sign = "23:59:59\t-"
96 sstamp_to_ymdhMs(NTP_timestamp - 1, ss_NTP)
113 print "# so that pre-2020a zic implementations do not reject this file."
125 epoch_minus_NTP = ((1970 - 1900) * 365 + 17) * 24 * 60 * 60
131 printf "#updated %d (%.4d-%.2d-%.2d %.2d:%.2d:%.2d UTC)\n", \
132 updated - epoch_minus_NTP, \
139 printf "#expires %d (%.4d-%.2d-%.2d %.2d:%.2d:%.2d UTC)\n", \
140 expires - epoch_minus_NTP, \
148 # sstamp_to_ymdhMs - convert seconds timestamp to date and time
156 # sstamp - is the seconds timestamp.
157 # epoch_days - is the timestamp epoch in Gregorian days since 1600-03-01.
163 # ss_year - Gregorian calendar year
164 # ss_month - month of the year (1-January to 12-December)
165 # ss_mday - day of the month (1-31)
166 # ss_hour - hour (0-23)
167 # ss_min - minute (0-59)
168 # ss_sec - second (0-59)
169 # ss_wday - day of week (0-Sunday to 6-Saturday)
188 # Counts of days in a Gregorian year, quad-year, century, and quad-century.
191 ss_century_days = ss_quadyear_days * 25 - 1
207 # Start with a count of days since 1600-03-01 Gregorian.
210 # Compute a year-month-day date with days of the month numbered
211 # 0-30, months (March-February) numbered 0-11, and years that start
212 # start March 1 and end after the last day of February. A quad-year
216 # A quad-century starts on and ends before March 1 in years divisible
217 # by 400. While the number of days in a quad-century is a constant,
223 day -= quadcentury * ss_quadcentury_days
226 century -= century == 4
227 day -= century * ss_century_days
229 day -= quadyear * ss_quadyear_days
231 year -= year == 4
232 day -= year * ss_year_days
236 day -= ss_mon_days[month]
239 # Convert the date to a conventional day of month (1-31),
240 # month (1-12, January-December) and Gregorian year.
245 ss_month = month - 9