Skip to content

Commit f24f7ec

Browse files
authored
Updated historic delta-T values from http://astro.ukho.gov.uk/nao/lvm/ (#11)
* Updated historic delta-T values from http://astro.ukho.gov.uk/nao/lvm/ (replacing data from maia.usno.navy.mil and https://stjarnhimlen.se/comp/time.html). * Added predicted delta-T for start of 2022. * Updated rough predictive future delta-T calculations.
1 parent 1de0107 commit f24f7ec

9 files changed

Lines changed: 107 additions & 105 deletions

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ Note that this only works for defined leap seconds. `new DateTime('2021-04-15 23
931931
* From TAI, Julian date, or modified Julian date values. For example:<br>
932932
`new DateTime('1972-07-01T00:00:10 TAI', 'UTC').toString()`
933933
`"DateTime<1972-06-30T23:59:60.000 +00:00>"`<br>
934-
`new DateTime({ jde: 2450630.500724913 }, 'UTC').toIsoString(19)`
934+
`new DateTime({ jde: 2450630.5007242477 }, 'UTC').toIsoString(19)`
935935
`"1997-06-30T23:59:60"`<br><br>
936936
* By add/subtract operations using TAI quantities:
937937
`new DateTime('2016-12-31 18:59:59 EST').add('seconds_tai', 1).toString()`
@@ -1286,6 +1286,7 @@ addDaysToDate(deltaDays: number, yearOrDate: YearOrDate, month?: number, day?: n
12861286
12871287
```typescript
12881288
static OS_ZONE: Timezone; // Local timezone as derived from analyzing values returned by JavaScript `Date`.
1289+
static TAI_ZONE: Timezone; // International Atomic Time (TAI).
12891290
static UT_ZONE: Timezone; // Universal Coordinated Time (AKA UTC, UCT, GMT, Zulu Time, etc.)
12901291
static ZONELESS: Timezone; // A pseudo timezone for abstract date/time instances.
12911292
static DATELESS: Timezone; // A pseudo timezone for abstract dateless, time-only `DateTime` instances.

package-lock.json

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@tubular/time",
3-
"version": "2.6.2",
4-
"description": "Date/time, IANA timezones, calendar with settable Julian/Gregorian switchover",
3+
"version": "2.6.4",
4+
"description": "Date/time, IANA timezones, leap seconds, TAI/UTC conversions, calendar with settable Julian/Gregorian switchover",
55
"browser": "dist/web/index.js",
66
"browser-es5": "dist/web5/index.js",
77
"main": "dist/es6/index.js",
@@ -19,6 +19,7 @@
1919
"document": "typedoc --name \"ks-date-time-zone\" --module commonjs --exclude \"**/*+(e2e|spec|index).ts\" --excludePrivate --excludeProtected --readme README.md --target ES5 --out docs src"
2020
},
2121
"keywords": [
22+
"astronomy",
2223
"calendar",
2324
"date",
2425
"gregorian",
@@ -27,6 +28,7 @@
2728
"leap second",
2829
"moment",
2930
"olson",
31+
"tdt",
3032
"tai",
3133
"time",
3234
"time zone",
@@ -44,9 +46,9 @@
4446
"@babel/core": "^7.13.16",
4547
"@babel/preset-env": "^7.13.15",
4648
"@babel/register": "^7.13.16",
47-
"@types/chai": "^4.2.16",
49+
"@types/chai": "^4.2.17",
4850
"@types/mocha": "^8.2.2",
49-
"@types/node": "^14.14.41",
51+
"@types/node": "^14.14.43",
5052
"@typescript-eslint/eslint-plugin": "^4.22.0",
5153
"@typescript-eslint/parser": "^4.22.0",
5254
"babel-loader": "^8.2.2",
@@ -65,7 +67,7 @@
6567
"terser-webpack-plugin": "^4.2.3",
6668
"ts-node": "^9.1.1",
6769
"typescript": "^4.2.4",
68-
"webpack": "^5.35.1",
70+
"webpack": "^5.36.0",
6971
"webpack-cli": "^4.6.0",
7072
"webpack-node-externals": "^2.5.2"
7173
},

src/date-time.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,8 @@ describe('DateTime', () => {
542542
expect(new DateTime('1995-12-31 23:59:60Z').compare(new DateTime('1995-12-31 23:59:59Z'))).to.be.greaterThan(0);
543543
expect(new DateTime('1996-12-31 23:59:60Z').toString()).to.equal('DateTime<1997-01-01T00:00:00.000 +00:00>');
544544
expect(new DateTime('1972-06-30 23:59:60Z', 'TAI').toString()).to.equal('DateTime<1972-07-01T00:00:10.000 TAI>');
545-
expect(new DateTime('1997-06-30 23:59:60Z').wallTime.jde).to.be.closeTo(2450630.500724913, 1E-9);
546-
expect(new DateTime({ jde: 2450630.500724913 }, 'utc').toIsoString(19)).to.equal('1997-06-30T23:59:60');
545+
expect(new DateTime('1997-06-30 23:59:60Z').wallTime.jde).to.be.closeTo(2450630.5007242477, 1E-9);
546+
expect(new DateTime({ jde: 2450630.5007242477 }, 'utc').toIsoString(19)).to.equal('1997-06-30T23:59:60');
547547

548548
expect(ttime.sort([new DateTime('1995-12-31 23:59:60Z'), new DateTime('1995-12-31 23:59:59Z')])
549549
.map(dt => dt.format(ttime.DATETIME_LOCAL_SECONDS)).join()).to.equal('1995-12-31T23:59:59,1995-12-31T23:59:60');
@@ -581,7 +581,7 @@ describe('DateTime', () => {
581581
});
582582

583583
it('should correctly handle TDT/UT/TAI conversions', () => {
584-
expect(new DateTime('1945-05-08Z').deltaTaiMillis).to.be.closeTo(-5249, 2);
584+
expect(new DateTime('1945-05-08Z').deltaTaiMillis).to.be.closeTo(-4965, 2);
585585

586586
expect(new DateTime('1995-12-31 23:59:59Z').add('second_tai', 1).toString()).to.equal('DateTime<1995-12-31T23:59:60.000 +00:00>');
587587
expect(new DateTime('1995-12-31 23:59:00Z').add(DateTimeField.MINUTE_TAI, 1).toString()).to.equal('DateTime<1995-12-31T23:59:60.000 +00:00>');

src/timezone-large-alt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const timezoneLargeAlt = /* trim-file-start */{ // tz database version: 2021a, years 1800-2088, rounded to nearest minute, filtered, calendar rollbacks eliminated
44
version: '2021a',
55
years: '1800-2088',
6-
deltaTs: '69.36 69.36',
6+
deltaTs: '69.36 69.36 69.45',
77
leapSeconds: '912 1096 1461 1826 2191 2557 2922 3287 3652 4199 4564 4929 5660 6574 7305 7670 8217 8582 8947 9496 10043 10592 13149 14245 15522 16617 17167',
88
'Africa/Abidjan': '-0016 +0000 0;-g/0/LMT 0/0/GMT;1;-2ldXI;;48e5;BFCIGMGNMLMRSHSLSNTG',
99
'Africa/Accra': '-0001 +0000 0;-1/0/LMT 0/0/GMT k/k u/0 u/u;1212121212121212121212121212121212121212121212131414141414141;-2bRzX 9RbX fdE 1BAk MLE 1Bck MLE 1Bck MLE 1Bck MLE 1BAk MLE 1Bck MLE 1Bck MLE 1Bck MLE 1BAk MLE 1Bck MLE 1Bck MLE 1Bck MLE 1BAk MLE 1Bck MLE 1Bck MLE 1Bck MLE 1BAk MLE 1Bck MLE 1Bck MLE 1Bck MLE Mok 1BXE M0k 1BXE fak 9vbu bjCu MLu 1Bcu MLu 1BAu MLu 1Bcu MLu 1Bcu MLu 1Bcu MLu;;41e5;GH',

src/timezone-large.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const timezoneLarge = /* trim-file-start */{ // tz database version: 2021a, years 1800-2088
44
version: '2021a',
55
years: '1800-2088',
6-
deltaTs: '69.36 69.36',
6+
deltaTs: '69.36 69.36 69.45',
77
leapSeconds: '912 1096 1461 1826 2191 2557 2922 3287 3652 4199 4564 4929 5660 6574 7305 7670 8217 8582 8947 9496 10043 10592 13149 14245 15522 16617 17167',
88
'Africa/Abidjan': '-001608 +0000 0;-g.8/0/LMT 0/0/GMT;1;-2ldXH.Q;;48e5;BFCIGMGNMLMRSHSLSNTG',
99
'Africa/Accra': '-000052 +0000 0;-0.Q/0/LMT 0/0/GMT k/k u/0 u/u;1212121212121212121212121212121212121212121212131414141414141;-2bRzX.8 9RbX.8 fdE 1BAk MLE 1Bck MLE 1Bck MLE 1Bck MLE 1BAk MLE 1Bck MLE 1Bck MLE 1Bck MLE 1BAk MLE 1Bck MLE 1Bck MLE 1Bck MLE 1BAk MLE 1Bck MLE 1Bck MLE 1Bck MLE 1BAk MLE 1Bck MLE 1Bck MLE 1Bck MLE Mok 1BXE M0k 1BXE fak 9vbu bjCu MLu 1Bcu MLu 1BAu MLu 1Bcu MLu 1Bcu MLu 1Bcu MLu;;41e5;GH',

src/timezone-small.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const timezoneSmall = /* trim-file-start */{ // tz database version: 2021a, years 2016-2026
44
version: '2021a',
55
years: '2016-2026',
6-
deltaTs: '69.36 69.36',
6+
deltaTs: '69.36 69.36 69.45',
77
leapSeconds: '912 1096 1461 1826 2191 2557 2922 3287 3652 4199 4564 4929 5660 6574 7305 7670 8217 8582 8947 9496 10043 10592 13149 14245 15522 16617 17167',
88
'Africa/Abidjan': '+0000 +0000 0;0/0/GMT;;;;48e5;BFCIGMGNMLMRSHSLSNTG',
99
'Africa/Algiers': '+0100 +0100 0;10/0/CET;;;;26e5;DZ',

src/ut-converter.spec.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ import { round } from '@tubular/math';
77

88
const SIX_MONTHS_DAYS = 180;
99
const TEST_DTS = [
10-
22.51, 23.01, 23.46, 23.63, 23.95, 24.39, 24.34, 24.1, 24.02, 23.98,
11-
23.89, 23.93, 23.88, 23.91, 23.76, 23.91, 23.96, 24.04, 24.35, 24.82,
12-
25.3, 25.77, 26.27, 26.76, 27.27, 27.77, 28.25, 28.7, 29.15, 29.57,
13-
29.97, 30.36, 30.72, 31.07, 31.35, 31.68, 32.17, 32.67, 33.15, 33.58,
14-
33.99, 34.47, 35.03, 35.74, 36.55, 37.43, 38.29, 39.2, 40.18, 41.17,
15-
42.23, 43.37, 44.48, 45.48, 46.46, 47.52, 48.53, 49.59, 50.54, 51.38,
16-
52.17, 52.96, 53.79, 54.34, 54.87, 55.32, 55.82, 56.3, 56.86, 57.57,
17-
58.31, 59.12, 59.98, 60.79, 61.63, 62.3, 62.97, 63.47, 63.83, 64.09,
18-
64.3, 64.47, 64.57, 64.69, 64.85, 65.15, 65.46, 65.78, 66.07, 66.32,
19-
66.6, 66.91, 67.28, 67.64, 68.1, 68.59, 68.97, 69.22, 69.36, 69.36
10+
22.69, 23.12, 23.49, 23.79, 24.02, 24.20, 24.32, 24.39, 24.42, 24.41,
11+
24.38, 24.32, 24.25, 24.16, 24.08, 24.04, 24.06, 24.17, 24.43, 24.83,
12+
25.35, 25.92, 26.51, 27.05, 27.51, 27.89, 28.24, 28.58, 28.93, 29.32,
13+
29.70, 30.00, 30.20, 30.41, 30.76, 31.34, 32.03, 32.65, 33.07, 33.36,
14+
33.62, 33.96, 34.44, 35.09, 35.95, 36.93, 37.96, 38.95, 39.93, 40.95,
15+
42.04, 43.15, 44.24, 45.28, 46.28, 47.29, 48.33, 49.37, 50.36, 51.28,
16+
52.13, 52.94, 53.70, 54.39, 54.98, 55.46, 55.89, 56.37, 56.99, 57.70,
17+
58.45, 59.19, 59.92, 60.68, 61.46, 62.23, 62.90, 63.42, 63.81, 64.08,
18+
64.27, 64.41, 64.55, 64.73, 64.95, 65.20, 65.48, 65.77, 66.06, 66.33,
19+
66.61, 66.92, 67.28, 67.69, 68.11, 68.53, 68.92, 69.24, 69.36, 69.36,
20+
69.45
2021
];
2122

2223
describe('UT/TDT Converter', () => {
@@ -32,7 +33,7 @@ describe('UT/TDT Converter', () => {
3233
expect(taiToUtMillis(utToTaiMillis(millis, true), true)).to.equal(millis);
3334
}
3435

35-
for (let y = 1922; y <= 2021; ++y) {
36+
for (let y = 1922; y <= 2022; ++y) {
3637
const now = new DateTime([y], 'UTC');
3738
const epochMillis = now.epochMillis;
3839
const deltaTai = round(now.wallTime.deltaTai * 1000);

0 commit comments

Comments
 (0)