Supplementary Materials for Common Calendar

Brooks Harris Version 5b 2017-01-25

Supplementary materials for

Common Calendar Fixed-epoch Deterministic UTC Based Reference Local Timescales Brooks Harris Version 5b 2017-01-25

Contents Annex A IERS History File Sample ...... 2 Annex B TAI-UTC API History Array ...... 3 Annex C Common Calendar Local Timescales...... 4 C.1 Table - Common Calendar Local Timescales...... 4 C.2 Table - Local Timescales Mapping to Idealized Longitude...... 6 Annex D c++ Listings ...... 8 D.1 Listing - TAI-UTC API, excerpts from TaiUtcApi.h...... 8 D.2 Listing - Tz Database API, excerpts from TzDatabaseApi.h ...... 8 D.3 Listing - YMDhms API, excerpts from YMDhmsApi.h...... 9 D.4 Listing - Common Calendar Binary Format, excerpts from CBF.h ...... 10 Annex E CCTDemoConsole c++ Implementation ...... 12 E.1 Output Listing - Interesting Points Of Year 2015 TOD_LEAPSECOND_UTC_UTC Count Mode . 12 E.2 Output Listing – Interesting Points Of Year 2015 TOD_LEAPSECOND_MIDNIGHT Count Mode 14

Page 1 Annex A IERS Leap Second History File Sample The IERS makes the Leap Second History available as text files at: https://hpiers.obspm.fr/iers/bul/bulc/Leap_Second.dat https://hpiers.obspm.fr/eoppc/bul/bulc/Leap_Second_History.dat Sample retrieved 2016-07-26: # Value of TAI-UTC in second valid beetween the initial value until # the epoch given on the next line. The last line reads that NO # leap second was introduced since the corresponding date # Updated through IERS Bulletin C52 issued in July 2016 # # # File expires on 28 June 2017 # # # MJD Date TAI-UTC (s) # day month year # ------# 41317.0 1 1 1972 10 41499.0 1 7 1972 11 41683.0 1 1 1973 12 42048.0 1 1 1974 13 42413.0 1 1 1975 14 42778.0 1 1 1976 15 43144.0 1 1 1977 16 43509.0 1 1 1978 17 43874.0 1 1 1979 18 44239.0 1 1 1980 19 44786.0 1 7 1981 20 45151.0 1 7 1982 21 45516.0 1 7 1983 22 46247.0 1 7 1985 23 47161.0 1 1 1988 24 47892.0 1 1 1990 25 48257.0 1 1 1991 26 48804.0 1 7 1992 27 49169.0 1 7 1993 28 49534.0 1 7 1994 29 50083.0 1 1 1996 30 50630.0 1 7 1997 31 51179.0 1 1 1999 32 53736.0 1 1 2006 33 54832.0 1 1 2009 34 56109.0 1 7 2012 35 57204.0 1 7 2015 36 57754.0 1 1 2017 37

Page 2 Annex B TAI-UTC API History Array

Table TAI-UTC API History Array shows the values in effect on the date of this document’s publication including the EXPIRATION entry in the last position.

Table TAI-UTC API History Array TAI-UTC API Comments Day TAI-UTC TAI UTC MJD Number 0 10 1972-01-01 00:00:10;00 (TAI) 1972-01-01T00:00:00;00 (UTC) 41317 182 11 1972-07-01 00:00:11;00 (TAI) 1972-07-01T00:00:00;00 (UTC) 41499 366 12 1973-01-01 00:00:12;00 (TAI) 1973-01-01T00:00:00;00 (UTC) 41683 731 13 1974-01-01 00:00:13;00 (TAI) 1974-01-01T00:00:00;00 (UTC) 42048 1096 14 1975-01-01 00:00:14;00 (TAI) 1975-01-01T00:00:00;00 (UTC) 42413 1461 15 1976-01-01 00:00:15;00 (TAI) 1976-01-01T00:00:00;00 (UTC) 42778 1827 16 1977-01-01 00:00:16;00 (TAI) 1977-01-01T00:00:00;00 (UTC) 43144 2192 17 1978-01-01 00:00:17;00 (TAI) 1978-01-01T00:00:00;00 (UTC) 43509 2557 18 1979-01-01 00:00:18;00 (TAI) 1979-01-01T00:00:00;00 (UTC) 43874 2922 19 1980-01-01 00:00:19;00 (TAI) 1980-01-01T00:00:00;00 (UTC) 44239 3469 20 1981-07-01 00:00:20;00 (TAI) 1981-07-01T00:00:00;00 (UTC) 44786 3834 21 1982-07-01 00:00:21;00 (TAI) 1982-07-01T00:00:00;00 (UTC) 45151 4199 22 1983-07-01 00:00:22;00 (TAI) 1983-07-01T00:00:00;00 (UTC) 45516 4930 23 1985-07-01 00:00:23;00 (TAI) 1985-07-01T00:00:00;00 (UTC) 46247 5844 24 1988-01-01 00:00:24;00 (TAI) 1988-01-01T00:00:00;00 (UTC) 47161 6575 25 1990-01-01 00:00:25;00 (TAI) 1990-01-01T00:00:00;00 (UTC) 47892 6940 26 1991-01-01 00:00:26;00 (TAI) 1991-01-01T00:00:00;00 (UTC) 48257 7487 27 1992-07-01 00:00:27;00 (TAI) 1992-07-01T00:00:00;00 (UTC) 48804 7852 28 1993-07-01 00:00:28;00 (TAI) 1993-07-01T00:00:00;00 (UTC) 49169 8217 29 1994-07-01 00:00:29;00 (TAI) 1994-07-01T00:00:00;00 (UTC) 49534 8766 30 1996-01-01 00:00:30;00 (TAI) 1996-01-01T00:00:00;00 (UTC) 50083 9313 31 1997-07-01 00:00:31;00 (TAI) 1997-07-01T00:00:00;00 (UTC) 50630 9862 32 1999-01-01 00:00:32;00 (TAI) 1999-01-01T00:00:00;00 (UTC) 51179 12419 33 2006-01-01 00:00:33;00 (TAI) 2006-01-01T00:00:00;00 (UTC) 53736 13515 34 2009-01-01 00:00:34;00 (TAI) 2009-01-01T00:00:00;00 (UTC) 54832 14792 35 2012-07-01 00:00:35;00 (TAI) 2012-07-01T00:00:00;00 (UTC) 56109 15887 36 2015-07-01 00:00:36;00 (TAI) 2015-07-01T00:00:00;00 (UTC) 57204 16437 37 2017-01-01 00:00:37;00 (TAI) 2017-01-01T00:00:00;00 (UTC) 57754 16615 37 2016-06-01 00:00:36;00 (TAI) 2016-06-01T00:00:00;00 (UTC) 57932

Page 3 Annex C Common Calendar Local Timescales

C.1 Table - Common Calendar Local Timescales

Common Calendar Local Timescales 0-104 (105) covering existing time zones: 12 negative signed, 1 for -00:00 at UTC, 12 positive signed, plus 2 positive signed for +13:00 (Pacific/Tongatapu) and +14:00 (Pacific/Kiritimati).

Column Key: Index – index number, 0-104 (105 entries), for simple a priori enumerated reference Name – defined fixed length 10-character name, each indicating its offset from UTC UUID – Universally Unique Identifier (RFC 4122) for unique id of each entry UTCT Offset Hours – Offset from UTCT in hours UTCT Offset Seconds – Offset from UTCT in seconds

UTCT UTCT Local Timescale Index Local Timescale UUID Identifier Offset Offset Name Hours Seconds 0 UTCT-12:00 {3E5C2389-9BD7-440C-BE24-2FA8BD8D61B4} -12.00 -43200 1 UTCT-11:45 {E4A95A29-AF5D-4531-8420-99C8BF6D8529} -11.75 -42300 2 UTCT-11:30 {66B613FC-A571-42FA-9B45-033EF952E409} -11.50 -41400 3 UTCT-11:15 {6C9F3EE4-63D3-47F4-A6FC-2C16B81D56FC} -11.25 -40500 4 UTCT-11:00 {6E5C598E-EC6B-4C85-9A51-3237D5904B24} -11.00 -39600 5 UTCT-10:45 {7C7ACC7A-48B2-4752-9ED0-3B5B7A229208} -10.75 -38700 6 UTCT-10:30 {D6884AEB-01DE-4DBC-99FB-2D9F071CDA5B} -10.50 -37800 7 UTCT-10:15 {2BD17A97-0F5B-4B22-886C-208950A3F916} -10.25 -36900 8 UTCT-10:00 {56F6302E-E97A-4713-AD19-BC8526642791} -10.00 -36000 9 UTCT-09:45 {D603EA13-D709-4BB6-A890-A63B7D7013A0} -9.75 -35100 10 UTCT-09:30 {78EF41E2-5A50-44AE-82E3-E47CFBDB1CD7} -9.50 -34200 11 UTCT-09:15 {20597A0D-BAC7-4363-AB3A-133A24561656} -9.25 -33300 12 UTCT-09:00 {62CF62FF-B73E-4FEA-A692-8EE92B3D8D45} -9.00 -32400 13 UTCT-08:45 {544649F7-CDE1-45F2-A72C-F9BE6EE5F648} -8.75 -31500 14 UTCT-08:30 {D31346B3-AE52-49F7-89E2-C7D2D51EA73A} -8.50 -30600 15 UTCT-08:15 {030883AF-910E-46EE-BACA-82CEB5D072BE} -8.25 -29700 16 UTCT-08:00 {00812176-842A-4350-9C39-1D921F2F9BF6} -8.00 -28800 17 UTCT-07:45 {2E09DCD6-B204-4DB5-B510-30E382C5F4D5} -7.75 -27900 18 UTCT-07:30 {227F1F99-A60C-4C6E-8DC0-EE436AB71A3A} -7.50 -27000 19 UTCT-07:15 {3176DDF3-BBF3-4CE6-9C59-E368EAC7D716} -7.25 -26100 20 UTCT-07:00 {18A4BA26-6F4F-4760-BB0D-19DF6DB3E1BE} -7.00 -25200 21 UTCT-06:45 {CE452410-7A3C-4317-90FD-4DA4FFE2B82B} -6.75 -24300 22 UTCT-06:30 {84FA7859-39F1-4A55-88C9-4AF4EBDE7CD3} -6.50 -23400 23 UTCT-06:15 {DBF15C30-4F45-4451-8BCA-2AF32B2C1F1B} -6.25 -22500 24 UTCT-06:00 {9CA40B1B-49CB-44D3-8BEC-C40507558C88} -6.00 -21600 25 UTCT-05:45 {0D6305B9-8D79-4D90-9FEA-C6674821FBE6} -5.75 -20700 26 UTCT-05:30 {4B157D77-5C22-4E73-8525-F29EB708B89C} -5.50 -19800 27 UTCT-05:15 {6052173F-7DBC-4264-88F1-341EC5378B07} -5.25 -18900 28 UTCT-05:00 {2F974276-A14B-4BFE-A4AB-77D83A5095B2} -5.00 -18000 29 UTCT-04:45 {16CC41D4-B43A-441B-9CE4-B9CF4C0066E4} -4.75 -17100 30 UTCT-04:30 {23BC1883-6384-4406-8AA6-05C7BDE70BE6} -4.50 -16200 31 UTCT-04:15 {BB7A4437-094A-4792-B45D-D3718427260F} -4.25 -15300 32 UTCT-04:00 {2C05B209-DBFA-4033-ADED-C02D2344D067} -4.00 -14400 33 UTCT-03:45 {58861950-521C-448B-BC4B-B9ADA5D023E7} -3.75 -13500 34 UTCT-03:30 {3AA60372-DAA9-4DB4-8396-2124A803974C} -3.50 -12600 35 UTCT-03:15 {1213E713-26E6-47BF-9AFC-ED663ADD9E8C} -3.25 -11700 36 UTCT-03:00 {10B9FC17-FCE2-401B-A47B-DA7B97C54FCF} -3.00 -10800 37 UTCT-02:45 {178468A0-4AB7-48B6-916E-DA7DA43C8D5D} -2.75 -9900 38 UTCT-02:30 {B0718A17-A053-490C-A546-9051211AFEE2} -2.50 -9000 39 UTCT-02:15 {729780B9-38C7-4EDD-B0F2-15FABD050586} -2.25 -8100 40 UTCT-02:00 {B462BB24-5978-4665-9787-44D4D040A3D4} -2.00 -7200 41 UTCT-01:45 {8B5B6E4C-1B86-4181-AF2F-AC34331BC68B} -1.75 -6300 42 UTCT-01:30 {687B106A-6ADF-4383-8A87-9775E750CA24} -1.50 -5400 43 UTCT-01:15 {6D54D1BC-2ECA-4408-A8A5-947994B6CBB9} -1.25 -4500 44 UTCT-01:00 {018455B3-B94C-4D7A-A178-7587AA353C21} -1.00 -3600 45 UTCT-00:45 {46C3F6A3-F676-42A6-ACFC-669D8F0F8CEF} -0.75 -2700

Page 4 46 UTCT-00:30 {D4F6CE81-B1E8-467F-9DCB-2F6F0C14ED38} -0.50 -1800 47 UTCT-00:15 {DF7CBE21-E03A-4EA3-9D73-BFA18135B000} -0.25 -900 48 UTCT-00:00 {57C5EA42-EC31-47FD-A92E-F15E71DCD40A} 0.00 0 49 UTCT+00:15 {8EFA5F27-8B29-45FE-A318-A6BEED4CBB80} 0.25 900 50 UTCT+00:30 {8E71E6AB-A357-492D-94EA-67FA2046ACDD} 0.50 1800 51 UTCT+00:45 {6DC4213E-9193-4ECF-9EE0-58812E0C5FC9} 0.75 2700 52 UTCT+01:00 {C597A231-8705-47CF-A6FB-1EB81A3A82F1} 1.00 3600 53 UTCT+01:15 {AA1BFD40-2ED1-4A0D-98AC-330425FFF90C} 1.25 4500 54 UTCT+01:30 {F9C83714-2EA4-4113-902C-1B16D3FF6E0E} 1.50 5400 55 UTCT+01:45 {7847D30C-DB87-48CA-9AE0-7D346A40E734} 1.75 6300 56 UTCT+02:00 {D390640C-0A44-4EF9-BDAD-E0D1C018BD86} 2.00 7200 57 UTCT+02:15 {6786C911-48DD-483F-B7DC-178FED481C00} 2.25 8100 58 UTCT+02:30 {44590B03-BC64-43DB-871B-4C499F3779FF} 2.50 9000 59 UTCT+02:45 {A28E1E49-2DE8-45D8-95E4-72F8475A32A8} 2.75 9900 60 UTCT+03:00 {9C9C855B-340D-4C89-BB48-23CD4A7FE1CD} 3.00 10800 61 UTCT+03:15 {8918736F-1B52-4A43-ADF7-61E4D389E11E} 3.25 11700 62 UTCT+03:30 {2E32B903-B7C9-484B-A188-4EDAAD88785A} 3.50 12600 63 UTCT+03:45 {FBF3745B-EF13-422F-B1E8-3805C8C37A95} 3.75 13500 64 UTCT+04:00 {2AB502F8-4B85-470F-8C78-C4CC5B5A4845} 4.00 14400 65 UTCT+04:15 {07025B32-8A94-4B54-A31D-FCA9D4A9EB14} 4.25 15300 66 UTCT+04:30 {173FDEAC-43A0-4578-86F2-917A4A8F509D} 4.50 16200 67 UTCT+04:45 {696FC036-D924-4AF2-AE44-03A44B1E5629} 4.75 17100 68 UTCT+05:00 {53531915-409D-455D-B2A6-2477C1BB2C9A} 5.00 18000 69 UTCT+05:15 {9006A021-BA84-4515-B297-7E6D010A2D43} 5.25 18900 70 UTCT+05:30 {EF28698F-9CF4-425A-B85F-7B08C35A40ED} 5.50 19800 71 UTCT+05:45 {574A2D3B-EE76-46C9-82D5-44451D3C4570} 5.75 20700 72 UTCT+06:00 {8D55D2BF-2AF5-40FD-9939-3D4D4795A5B1} 6.00 21600 73 UTCT+06:15 {B520AE71-B05F-495D-9915-F2AEAD5485D1} 6.25 22500 74 UTCT+06:30 {01322642-8498-4621-84F8-24C2ADC0F703} 6.50 23400 75 UTCT+06:45 {30E01A0C-088A-4690-8EA3-2143E3B639EA} 6.75 24300 76 UTCT+07:00 {086FC4F4-21EF-4738-B93B-FA2D12E608F4} 7.00 25200 77 UTCT+07:15 {563CD14B-7391-4043-87C6-9CF64820C3C2} 7.25 26100 78 UTCT+07:30 {D9441977-E9B0-4474-BC83-2C6678D2983B} 7.50 27000 79 UTCT+07:45 {EC1E59CE-0B96-4CAC-A326-8A06366909FE} 7.75 27900 80 UTCT+08:00 {6EEE4892-18EE-4A55-BF0D-20A4464CB509} 8.00 28800 81 UTCT+08:15 {DFE35E6D-AEF4-43ED-886D-22F20C237CCB} 8.25 29700 82 UTCT+08:30 {7B991E69-0646-404B-B507-0EDFD0E262B5} 8.50 30600 83 UTCT+08:45 {386A388E-EA43-48D5-BC37-188DA092BF8B} 8.75 31500 84 UTCT+09:00 {CCA75843-5FC8-4EBE-AA5A-3B389AEE2FBE} 9.00 32400 85 UTCT+09:15 {65C713C2-6178-471D-887D-124EE3C5C02F} 9.25 33300 86 UTCT+09:30 {E836CA5D-A881-4282-AEE6-BE024BFB04EC} 9.50 34200 87 UTCT+09:45 {8403C0B2-9607-4330-8BEC-31AA9CD8A27D} 9.75 35100 88 UTCT+10:00 {22E68FE6-DAE9-4B4C-82A4-BDE00A23C913} 10.00 36000 89 UTCT+10:15 {BFCD9C40-5220-4FD9-9184-ABCD78231121} 10.25 36900 90 UTCT+10:30 {4EF2D863-7DEE-4625-ACAF-0FA3456668D0} 10.50 37800 91 UTCT+10:45 {18EA9DE8-02AB-480E-94DB-3972394600BC} 10.75 38700 92 UTCT+11:00 {E806CFA9-B3C5-4285-B1C6-76A2AAE61FAF} 11.00 39600 93 UTCT+11:15 {54F40C0B-C13D-476F-987F-11C91CB40961} 11.25 40500 94 UTCT+11:30 {405AB823-4F87-4367-B2B7-CD0CFBA28708} 11.50 41400 95 UTCT+11:45 {8DEDC716-4A74-4129-AB18-88D96C7636CB} 11.75 42300 96 UTCT+12:00 {25CF1F00-C108-488D-A618-45B5F8B51663} 12.00 43200 97 UTCT+12:15 {F51DC296-C647-40B6-9245-67A46761EDFF} 12.25 44100 98 UTCT+12:30 {B0E18990-B785-440C-8A17-E747751A8A68} 12.50 45000 99 UTCT+12:45 {B935F54B-4716-4CD9-81B5-226C30BF38C3} 12.75 45900 100 UTCT+13:00 {BB13C612-0838-4E16-9931-D33FC2C7ADBF} 13.00 46800 101 UTCT+13:15 {A63C5663-61A5-43A5-BEB7-5D7AB3E9B025} 13.25 47700 102 UTCT+13:30 {B37A1EBD-6BAA-4F12-9766-945A238591DC} 13.50 48600 103 UTCT+13:45 {34E2D34C-86DF-4D97-9898-D8E82AE2A219} 13.75 49500 104 UTCT+14:00 {4611445C-98D6-415A-8424-9E8FBF68B834} 14.00 50400

Page 5 C.2 Table - Local Timescales Mapping to Idealized Longitude

Common Calendar specifies use of an idealized Euclidean geometry sphere to approximately represent the Earth and so approximate longitudes for purposes of civil timekeeping. 0° longitude corresponds to the IERS Reference Meridian (IRM). UTCT means UTC time at the IRM and this is associated with a longitude position with each Local Timescale. See Table - Local Timescales Mapping to Idealized Longitude

WARNING: DO NOT USE FOR NAVIAGATION PURPOSES - FOR CIVIL TIMEKEEPING ONLY

Column Key: Index – index number, 0-104 (105 entries), for simple a priori enumerated reference Name – Common Calendar Local Timescale Name from Table - Common Calendar Local Timescales Longitude - degrees Longitude East or West

Local Timescale Longitude Index Longitude Name East West 0 UTCT-12:00 -180.00 1 UTCT-11:45 -176.25 West 2 UTCT-11:30 -172.50 West 3 UTCT-11:15 -168.75 West 4 UTCT-11:00 -165.00 West 5 UTCT-10:45 -161.25 West 6 UTCT-10:30 -157.50 West 7 UTCT-10:15 -153.75 West 8 UTCT-10:00 -150.00 West 9 UTCT-09:45 -146.25 West 10 UTCT-09:30 -142.50 West 11 UTCT-09:15 -138.75 West 12 UTCT-09:00 -135.00 West 13 UTCT-08:45 -131.25 West 14 UTCT-08:30 -127.50 West 15 UTCT-08:15 -123.75 West 16 UTCT-08:00 -120.00 West 17 UTCT-07:45 -116.25 West 18 UTCT-07:30 -112.50 West 19 UTCT-07:15 -108.75 West 20 UTCT-07:00 -105.00 West 21 UTCT-06:45 -101.25 West 22 UTCT-06:30 -97.50 West 23 UTCT-06:15 -93.75 West 24 UTCT-06:00 -90.00 West 25 UTCT-05:45 -86.25 West 26 UTCT-05:30 -82.50 West 27 UTCT-05:15 -78.75 West 28 UTCT-05:00 -75.00 West 29 UTCT-04:45 -71.25 West 30 UTCT-04:30 -67.50 West 31 UTCT-04:15 -63.75 West 32 UTCT-04:00 -60.00 West 33 UTCT-03:45 -56.25 West 34 UTCT-03:30 -52.50 West 35 UTCT-03:15 -48.75 West 36 UTCT-03:00 -45.00 West 37 UTCT-02:45 -41.25 West 38 UTCT-02:30 -37.50 West 39 UTCT-02:15 -33.75 West 40 UTCT-02:00 -30.00 West 41 UTCT-01:45 -26.25 West 42 UTCT-01:30 -22.50 West 43 UTCT-01:15 -18.75 West 44 UTCT-01:00 -15.00 West 45 UTCT-00:45 -11.25 West 46 UTCT-00:30 -7.50 West 47 UTCT-00:15 -3.75 West

Page 6 48 UTCT-00:00 0.00 49 UTCT+00:15 3.75 East 50 UTCT+00:30 7.50 East 51 UTCT+00:45 11.25 East 52 UTCT+01:00 15.00 East 53 UTCT+01:15 18.75 East 54 UTCT+01:30 22.50 East 55 UTCT+01:45 26.25 East 56 UTCT+02:00 30.00 East 57 UTCT+02:15 33.75 East 58 UTCT+02:30 37.50 East 59 UTCT+02:45 41.25 East 60 UTCT+03:00 45.00 East 61 UTCT+03:15 48.75 East 62 UTCT+03:30 52.50 East 63 UTCT+03:45 56.25 East 64 UTCT+04:00 60.00 East 65 UTCT+04:15 63.75 East 66 UTCT+04:30 67.50 East 67 UTCT+04:45 71.25 East 68 UTCT+05:00 75.00 East 69 UTCT+05:15 78.75 East 70 UTCT+05:30 82.50 East 71 UTCT+05:45 86.25 East 72 UTCT+06:00 90.00 East 73 UTCT+06:15 93.75 East 74 UTCT+06:30 97.50 East 75 UTCT+06:45 101.25 East 76 UTCT+07:00 105.00 East 77 UTCT+07:15 108.75 East 78 UTCT+07:30 112.50 East 79 UTCT+07:45 116.25 East 80 UTCT+08:00 120.00 East 81 UTCT+08:15 123.75 East 82 UTCT+08:30 127.50 East 83 UTCT+08:45 131.25 East 84 UTCT+09:00 135.00 East 85 UTCT+09:15 138.75 East 86 UTCT+09:30 142.50 East 87 UTCT+09:45 146.25 East 88 UTCT+10:00 150.00 East 89 UTCT+10:15 153.75 East 90 UTCT+10:30 157.50 East 91 UTCT+10:45 161.25 East 92 UTCT+11:00 165.00 East 93 UTCT+11:15 168.75 East 94 UTCT+11:30 172.50 East 95 UTCT+11:45 176.25 East 96 UTCT+12:00 180.00 97 UTCT+12:15 -176.25 West 98 UTCT+12:30 -172.50 West 99 UTCT+12:45 -168.75 West 100 UTCT+13:00 -165.00 West 101 UTCT+13:15 -161.25 West 102 UTCT+13:30 -157.50 West 103 UTCT+13:45 -153.75 West 104 UTCT+14:00 -150.00 West

Page 7 Annex D c++ Listings

A c++ implementation called CCTDemoConsole has been developed to verify the Common Calendar design and provide a prototype reference implementation. These listings show selected exerpts from the header files.

D.1 Listing - TAI-UTC API, excerpts from TaiUtcApi.h

typedef struct DateTaiUtc_st // 4 bytes, 32-bit { int m_ui1972DayNumber:21; // zero-based 86400-second days // since 1972-01-01T00:00:00 (UTC) // 2^21 = 2097152 MAX unsigned int m_ui1972TAI_UTC:11; // TAI-UTC (initial 10s // offset at UTCT1972 plus Leap // Seconds) // 2^11 = 2048 MAX // IF zero m_ui1972DayNumber is negative // and TAI-UTC == 10 } DateTaiUtc_st;

D.2 Listing - Tz Database API, excerpts from TzDatabaseApi.h typedef enum TzDatabaseZone_et { AFRICA_ABIDJAN, AFRICA_ACCRA, AFRICA_ADDIS_ABABA, …. AMERICA_NEW_YORK, …. EUROPE_LONDON, …. ASIA_TOKYO, …. } TzDatabaseZone_et; extern enum UTCTOFFSET_et; typedef struct TzDatabaseZone_st { int m_iIdx; UTCTOFFSET_et m_UTCTOFFSET_et; char m_sUtctOffset[16]; TzDatabaseZone_et m_TzDatabaseZone_et; char m_sTzDatabaseZone[40]; char m_sTzDatabaseZoneAbbrev[24]; } TzDatabaseZone_st; typedef struct DstRule_st { unsigned short m_DstYearIn:12; // [0-4096] (zero based count) // 2^14 = 16384 MAX unsigned short m_DstMonth:4; // [1-12] (one based count) // 2^4 = 16 MAX unsigned short m_DstYearOut:12; // [0-4096] (zero based count) // 2^14 = 16384 MAX unsigned short m_DstDayOfWeek:3; // [0-6] (Sunday = 0) // 2^3 = 8 MAX unsigned short m_Reserved1:1; unsigned char m_DstTimeOfDay:7; // [0-95] (MAC 96 for 15 minute intervals)

Page 8 // 2^7 = 128 MAX unsigned char m_IsOnset:1; // 0 = retreat, 1 = onset unsigned char m_DstDayOfMonth:5; // [0-30] (days enumerated values 1-31) // 2^5 = 32 MAX // DAYOFMONTH_NOTAPPLICABLE0 == (MAX 32) unsigned char m_DstBias:3; // [0-8] (15, 30, 45) // 2^3 = 8 MAX unsigned char m_DstWeekOfMonth:3; // [0-5] (MAX 6 because you can have part // of the previous month in 1st week // and part of the next month in the 6th) // 2^3 = 8 MAX unsigned char m_DSTRULE:3; // See typedef enum DSTRULE_et // 2^3 = 8 MAX unsigned char m_Reserved2:2; } DstRule_st;

D.3 Listing - YMDhms API, excerpts from YMDhmsApi.h

/////////////////////////////////////////////////////// // i64CCTTime_t is analogous to POSIX-time time_t (seconds since the Epoch) // it is signed 64-bit typedef signed __int64 i641972Time_t;

/////////////////////////////////////////////////////// // YMDhms_tm is analogous to POSIX-time struct tm (broken down time) typedef struct YMDhms_tm { int m_iSecond; // Seconds after the minute [0 - 60] // zero based count // range at least 61 (2^6 = 64 MAX) // supports positive Leap Second (23:59:60) int m_iMinute; // Minutes after the hour [0 - 59] // zero based count // range at least 60 (2^6 = 64 MAX) int m_iHour; // Hours since midnight [0 - 24] // zero based count // supports DST 23 and 25 hour day // range at least 25 (2^5 = 32 MAX) int m_iDay; // Day of the month [1 - 28, 29, 30, 31] // one based count // range at least 31 (2^5 = 32 MAX) int m_iMonth; // Months since January [1 - 12] // one based count // range at least 12 (2^4 = 16 MAX) int m_iYear; // Years [0000-9999] // zero based count // range at least 10000 (2^14 = 16384 MAX) int m_iDayOfWeek; // Days since Sunday [0 - 6] // zero based count // range at least 7 (2^3 = 8 MAX) int m_iDaysInMonth; // [28 or 29 or 30 or 31] // range at least 31 (2^5 = 32 MAX) int m_iDayOfYear; // Days since January 1 [0 - 365, 366 MAX] 365 = 366th day // zero based count // range at least 367 (2^8 = 256 MAX) int m_iDaysSince1900; // Day number since 1900-01-01T00:00:00 (UTC) [0 - n] // zero based count // range at least (3100 years * 366) = 1134600 int m_iDaysSince1972; // Day number since 1900-01-01T00:00:00 (UTC) [0 - n] // zero based count // range at least (3100 years * 366) = 1134600 // (2^21 = 2097152 MAX) int m_bIsLeapYear; // Year is a leap year // [0 false or 1 true]

Page 9 int m_iLeapYearsSince1900; // Leap years since 1900-01-01T00:00:00 (UTC) [0 - n] // zero based count // range at least 367 (2^8 = 256 MAX) int m_iLeapYearsSince1972; // Leap years since 1972-01-01T00:00:00 (UTC) [0 - n] // zero based count // range at least 367 (2^8 = 256 MAX) int m_iTAI_UTC; // TAI-UTC (initial 10s calibration offset at UTCT1972 // plus Leap Seconds; "LeapSecondsInEffect" == UTC_TAI - 10s) // range 2048 (2^11 = 2048 MAX) int m_bIsLeapSecondDay; // A Leap Second will occur at end of this day // [0 false or 1 true] int m_bIsLeapSecondNegative; // if today is a Leap Second day the Leap Second // is negative // [0 false or 1 true] int m_bIsLeapSecond; // This second is Leap Second // [0 false or 1 true] } YMDhms_tm;

D.4 Listing - Common Calendar Binary Format, excerpts from CBF.h typedef struct CBFTime_st // 5 bytes, 40-bit { unsigned char m_eRateEnumeration:4; // Enumerated clock rates // See CBFRATE_et unsigned char m_bLocalDateExtension:1; // CBFLocalDate_st extension // is present // See CBFLocalDate_st unsigned char m_bCounterSign:1; // 1 = counter value is negative unsigned char m_eCounterSize:2; // Enumerated 32/48/64-bit size // See COUNTERSIZE_et unsigned long m_ulCounterLow32; // 32 bit unsigned counter // treated as low word is counter // size extension present } CBFTime_st; typedef enum CBFRATE_et { CLOCK_UNKNOWN = 0, CLOCK_0 , // seconds CLOCK_1 , // 10/1 seconds CLOCK_2 , // 100/1 seconds CLOCK_3 , // Millisecond CLOCK_6 , // Microsecond CLOCK_9 , // Nanosecond CLOCK_12 , // Picosecond CLOCK_15 , // Femtosecond CLOCK_18 , // Attosecond CLOCK_21 , // Zeptosecond CLOCK_24 , // Yactosecond CLOCK_44 , // Planck time } CBFRATE_et;

typedef struct CBFLocalDate_st // 8 bytes, 64-bit { DateTaiUtc_st m_CBFDateTaiUtc_st; // UTC1972 Day number // and TAI-UTC values // See DateTaiUtc.h - // DateTaiUtc_st unsigned short m_eTZDatabase:10; // tz datebase zone id // see TzDatabaseZone_et unsigned char m_eUTCTOffset:7; // UTCTOFFSET_et enum // 0 - 104 (105 MAX) // See DateTaiUtc.h - unsigned char m_bTAIUTCInterval:1; // TBOTaiUtcInterval_st

Page 10 // present following this // TBOLocalTime_st struct unsigned char m_eTODMode:3; // TODMode_et // See TODMode_et unsigned char m_bIsLeapSecond:1; // this second is a Leap Second unsigned char m_bIsLeapSecondDay:1; // today is a Leap Second day unsigned char m_bIsLeapSecondNegative:1; // Leap Second is negative unsigned char m_bDSTMetadata:1; // CBFDst_st present // following this // TBOLocalTime_st struct // or TBOTaiUtcInterval_st if // present // see CBFDst_st } CBFLocalDate_st; typedef struct CBFDst_st // 3 bytes, 24-bit { unsigned char m_eDSTBias:3; // DST bias enum // See TBODstBias_et unsigned char m_eDSTState:2; // TBODstState_et // See TBODstState_et unsigned char m_eDSTChangeDay:2; // TBODstChangeDay_et // See TBODstChangeDay_et unsigned char m_bDSTSchedule:1; // Dst schedule extension present // See TBODstCountMode_et; // See TBODstCountMode_et; unsigned char m_eDSTChangeTime:7; // See TIMEOFDAY15MIN_et unsigned char m_uiReserved:1; unsigned char m_eDSTCountMode:2; // Dst count scheme enum unsigned char m_uiReserved2:5; } CBFDst_st; typedef enum CBFDstCountMode_et { DSTCOUNTMODE_NOTOBSERVED = 0, DSTCOUNTMODE_CONVENTIONAL, DSTCOUNTMODE_UNINTERRUPTED } CBFDstCountMode_et;

Page 11 Annex E CCTDemoConsole c++ Implementation

A c++ implementation called CCTDemoConsole has been developed to verify the Common Calendar design and provide a prototype reference implementation. Two output listings are presented to illustrate important characteristics of Common Calendar.  E.1 Output Listing – Interesting Points Of Year 2015 TOD_LEAPSECOND_UTC_UTC Count Mode  E.2 Output Listing - Interesting Points Of Year 2015 TOD_LEAPSECOND_MIDNIGHT Count Mode E.1 uses the TOD_LEAPSECOND_UTC_UTC Count Mode and so generates Leap Second introduction simultaneous with UTC consistent with common practice. E.2 uses the TOD_LEAPSECOND_MIDNIGHT Count Mode and so generates Leap Second introduction at the local time midnight, eliminating midday YMDhms discontinuities. Both listings show two CCT character formatted timestamps at the boundaries of:  The 1st and last day of year  Daylight Savings Onset and Retreat  Leap Seconds For zones EUROPE_BERLIN, EUROPE_LONDON, ETC_UTC, AMERICA_NEW_YORK, and AMERICA_LOS_ANGELES.

E.1 Output Listing - Interesting Points Of Year 2015 TOD_LEAPSECOND_UTC_UTC Count Mode

---- Test interesting points of year ------TOD_LEAPSECOND_UTC_UTC Count Mode ----

Lists the 1st and last day of year Lists and marks Leap Seconds as found in Leap Second Table Lists and marks Onset and Retreat as found in zones DST rules

- 2015 EUROPE_BERLIN - D2014-12-31T23:59:59U+01:00PberlinV2016cL35Sc4wMu_ // 1356998424 000000000 D2015-01-01T00:00:00U+01:00PberlinV2016cL35Sc4wMu_ // 1356998425 000000000

DST Onset D2015-03-29T00:59:59U+01:00PberlinV2016cL35Sc4w+04Mu_ // 1364518824 000000000 D2015-03-29T02:00:00U+01:00PberlinV2016cL35Sc4s+04Mm_ // 1364518825 000000000

Leap Second D2015-07-01T01:59:60U+01:00PberlinV2016cL35*Sc4sMu_ // 1372640425 000000000 D2015-07-01T02:00:00U+01:00PberlinV2016cL36+Sc4sMu_ // 1372640426 000000000

DST Retreat D2015-10-25T01:59:59U+01:00PberlinV2016cL36Sc4s-04Mu_ // 1382662825 000000000 D2015-10-25T01:00:00U+01:00PberlinV2016cL36Sc4w-04Mm_ // 1382662826 000000000

D2015-12-31T23:59:59U+01:00PberlinV2016cL36Sc4wMu_ // 1388534425 000000000 D2016-01-01T00:00:00U+01:00PberlinV2016cL36Sc4wMu_ // 1388534426 000000000

- 2015 EUROPE_LONDON - D2014-12-31T23:59:59U-00:00PlondonV2016cL35Sc4wMu_ // 1356998424 000000000 D2015-01-01T00:00:00U-00:00PlondonV2016cL35Sc4wMu_ // 1356998425 000000000

DST Onset D2015-03-29T00:59:59U-00:00PlondonV2016cL35Sc4w+04Mu_ // 1364518824 000000000 D2015-03-29T02:00:00U-00:00PlondonV2016cL35Sc4s+04Mm_ // 1364518825 000000000

Leap Second

Page 12 D2015-07-01T00:59:60U-00:00PlondonV2016cL35*Sc4sMu_ // 1372636825 000000000 D2015-07-01T01:00:00U-00:00PlondonV2016cL36+Sc4sMu_ // 1372636826 000000000

DST Retreat D2015-10-25T01:59:59U-00:00PlondonV2016cL36Sc4s-04Mu_ // 1382662825 000000000 D2015-10-25T01:00:00U-00:00PlondonV2016cL36Sc4w-04Mm_ // 1382662826 000000000

D2015-12-31T23:59:59U-00:00PlondonV2016cL36Sc4wMu_ // 1388534425 000000000 D2016-01-01T00:00:00U-00:00PlondonV2016cL36Sc4wMu_ // 1388534426 000000000

- 2015 ETC_UTC - D2014-12-31T23:59:59U-00:00PetcutcV2016cL35Mu_ // 1356998424 000000000 D2015-01-01T00:00:00U-00:00PetcutcV2016cL35Mu_ // 1356998425 000000000

Leap Second D2015-06-30T23:59:60U-00:00PetcutcV2016cL35*Mu_ // 1372636825 000000000 D2015-07-01T00:00:00U-00:00PetcutcV2016cL36Mu_ // 1372636826 000000000

D2015-12-31T23:59:59U-00:00PetcutcV2016cL36Mu_ // 1388534425 000000000 D2016-01-01T00:00:00U-00:00PetcutcV2016cL36Mu_ // 1388534426 000000000

- 2015 AMERICA_NEW_YORK - D2014-12-31T23:59:59U-05:00Pnew#yorkV2016cL35Sc4wMu_ // 1356998424 000000000 D2015-01-01T00:00:00U-05:00Pnew#yorkV2016cL35Sc4wMu_ // 1356998425 000000000

DST Onset D2015-03-15T01:59:59U-05:00Pnew#yorkV2016cL35Sc4w+04Mu_ // 1363312824 000000000 D2015-03-15T03:00:00U-05:00Pnew#yorkV2016cL35Sc4s+08Mm_ // 1363312825 000000000

Leap Second D2015-06-30T19:59:60U-05:00Pnew#yorkV2016cL35*Sc4sMu_ // 1372618825 000000000 D2015-06-30T20:00:00U-05:00Pnew#yorkV2016cL36+Sc4sMu_ // 1372618826 000000000

DST Retreat D2015-11-08T01:59:59U-05:00Pnew#yorkV2016cL36Sc4s-08Mu_ // 1383872425 000000000 D2015-11-08T01:00:00U-05:00Pnew#yorkV2016cL36Sc4w-08Mm_ // 1383872426 000000000

D2015-12-31T23:59:59U-05:00Pnew#yorkV2016cL36Sc4wMu_ // 1388534425 000000000 D2016-01-01T00:00:00U-05:00Pnew#yorkV2016cL36Sc4wMu_ // 1388534426 000000000

- 2015 AMERICA_LOS_ANGELES - D2014-12-31T23:59:59U-08:00Plos#angelesV2016cL35Sc4wMu_ // 1356998424 000000000 D2015-01-01T00:00:00U-08:00Plos#angelesV2016cL35Sc4wMu_ // 1356998425 000000000

DST Onset D2015-03-15T01:59:59U-08:00Plos#angelesV2016cL35Sc4w+04Mu_ // 1363312824 000000000 D2015-03-15T03:00:00U-08:00Plos#angelesV2016cL35Sc4s+08Mm_ // 1363312825 000000000

Leap Second D2015-06-30T16:59:60U-08:00Plos#angelesV2016cL35*Sc4sMu_ // 1372608025 000000000 D2015-06-30T17:00:00U-08:00Plos#angelesV2016cL36+Sc4sMu_ // 1372608026 000000000

DST Retreat D2015-11-08T01:59:59U-08:00Plos#angelesV2016cL36Sc4s-08Mu_ // 1383872425 000000000 D2015-11-08T01:00:00U-08:00Plos#angelesV2016cL36Sc4w-08Mm_ // 1383872426 000000000

D2015-12-31T23:59:59U-08:00Plos#angelesV2016cL36Sc4wMu_ // 1388534425 000000000 D2016-01-01T00:00:00U-08:00Plos#angelesV2016cL36Sc4wMu_ // 1388534426 000000000

Page 13 E.2 Output Listing – Interesting Points Of Year 2015 TOD_LEAPSECOND_MIDNIGHT Count Mode

------

---- Test interesting points of year ------TOD_LEAPSECOND_MIDNIGHT Count Mode ----

Lists the 1st and last day of year Lists and marks Leap Seconds as found in Leap Second Table Lists and marks Onset and Retreat as found in zones DST rules

- 2015 EUROPE_BERLIN - D2014-12-31T23:59:59U+01:00PberlinV2016cL35Sc4wMm_ // 1356998424 000000000 D2015-01-01T00:00:00U+01:00PberlinV2016cL35Sc4wMm_ // 1356998425 000000000

DST Onset D2015-03-29T00:59:59U+01:00PberlinV2016cL35Sc4w+04Mm_ // 1364518824 000000000 D2015-03-29T02:00:00U+01:00PberlinV2016cL35Sc4s+04Mm_ // 1364518825 000000000

Leap Second D2015-06-30T23:59:60U+01:00PberlinV2016cL35*Sc4sMm_ // 1372633225 000000000 D2015-07-01T00:00:00U+01:00PberlinV2016cL36Sc4sMm_ // 1372633226 000000000

DST Retreat D2015-10-25T01:59:59U+01:00PberlinV2016cL36Sc4s-04Mm_ // 1382662825 000000000 D2015-10-25T01:00:00U+01:00PberlinV2016cL36Sc4w-04Mm_ // 1382662826 000000000

D2015-12-31T23:59:59U+01:00PberlinV2016cL36Sc4wMm_ // 1388534425 000000000 D2016-01-01T00:00:00U+01:00PberlinV2016cL36Sc4wMm_ // 1388534426 000000000

- 2015 EUROPE_LONDON - D2014-12-31T23:59:59U-00:00PlondonV2016cL35Sc4wMm_ // 1356998424 000000000 D2015-01-01T00:00:00U-00:00PlondonV2016cL35Sc4wMm_ // 1356998425 000000000

DST Onset D2015-03-29T00:59:59U-00:00PlondonV2016cL35Sc4w+04Mm_ // 1364518824 000000000 D2015-03-29T02:00:00U-00:00PlondonV2016cL35Sc4s+04Mm_ // 1364518825 000000000

Leap Second D2015-06-30T23:59:60U-00:00PlondonV2016cL35*Sc4sMm_ // 1372633225 000000000 D2015-07-01T00:00:00U-00:00PlondonV2016cL36Sc4sMm_ // 1372633226 000000000

DST Retreat D2015-10-25T01:59:59U-00:00PlondonV2016cL36Sc4s-04Mm_ // 1382662825 000000000 D2015-10-25T01:00:00U-00:00PlondonV2016cL36Sc4w-04Mm_ // 1382662826 000000000

D2015-12-31T23:59:59U-00:00PlondonV2016cL36Sc4wMm_ // 1388534425 000000000 D2016-01-01T00:00:00U-00:00PlondonV2016cL36Sc4wMm_ // 1388534426 000000000

- 2015 ETC_UTC - D2014-12-31T23:59:59U-00:00PetcutcV2016cL35Mm_ // 1356998424 000000000 D2015-01-01T00:00:00U-00:00PetcutcV2016cL35Mm_ // 1356998425 000000000

Leap Second D2015-06-30T23:59:60U-00:00PetcutcV2016cL35*Mm_ // 1372636825 000000000 D2015-07-01T00:00:00U-00:00PetcutcV2016cL36Mm_ // 1372636826 000000000

D2015-12-31T23:59:59U-00:00PetcutcV2016cL36Mm_ // 1388534425 000000000 D2016-01-01T00:00:00U-00:00PetcutcV2016cL36Mm_ // 1388534426 000000000

- 2015 AMERICA_NEW_YORK -

Page 14 D2014-12-31T23:59:59U-05:00Pnew#yorkV2016cL35Sc4wMm_ // 1356998424 000000000 D2015-01-01T00:00:00U-05:00Pnew#yorkV2016cL35Sc4wMm_ // 1356998425 000000000

DST Onset D2015-03-15T01:59:59U-05:00Pnew#yorkV2016cL35Sc4w+04Mm_ // 1363312824 000000000 D2015-03-15T03:00:00U-05:00Pnew#yorkV2016cL35Sc4s+08Mm_ // 1363312825 000000000

Leap Second D2015-06-30T23:59:60U-05:00Pnew#yorkV2016cL35*Sc4sMm_ // 1372633225 000000000 D2015-07-01T00:00:00U-05:00Pnew#yorkV2016cL36Sc4sMm_ // 1372633226 000000000

DST Retreat D2015-11-08T01:59:59U-05:00Pnew#yorkV2016cL36Sc4s-08Mm_ // 1383872425 000000000 D2015-11-08T01:00:00U-05:00Pnew#yorkV2016cL36Sc4w-08Mm_ // 1383872426 000000000

D2015-12-31T23:59:59U-05:00Pnew#yorkV2016cL36Sc4wMm_ // 1388534425 000000000 D2016-01-01T00:00:00U-05:00Pnew#yorkV2016cL36Sc4wMm_ // 1388534426 000000000

- 2015 AMERICA_LOS_ANGELES - D2014-12-31T23:59:59U-08:00Plos#angelesV2016cL35Sc4wMm_ // 1356998424 000000000 D2015-01-01T00:00:00U-08:00Plos#angelesV2016cL35Sc4wMm_ // 1356998425 000000000

DST Onset D2015-03-15T01:59:59U-08:00Plos#angelesV2016cL35Sc4w+04Mm_ // 1363312824 000000000 D2015-03-15T03:00:00U-08:00Plos#angelesV2016cL35Sc4s+08Mm_ // 1363312825 000000000

Leap Second D2015-06-30T23:59:60U-08:00Plos#angelesV2016cL35*Sc4sMm_ // 1372633225 000000000 D2015-07-01T00:00:00U-08:00Plos#angelesV2016cL36Sc4sMm_ // 1372633226 000000000

DST Retreat D2015-11-08T01:59:59U-08:00Plos#angelesV2016cL36Sc4s-08Mm_ // 1383872425 000000000 D2015-11-08T01:00:00U-08:00Plos#angelesV2016cL36Sc4w-08Mm_ // 1383872426 000000000

D2015-12-31T23:59:59U-08:00Plos#angelesV2016cL36Sc4wMm_ // 1388534425 000000000 D2016-01-01T00:00:00U-08:00Plos#angelesV2016cL36Sc4wMm_ // 1388534426 000000000

Page 15