Skip to content

Commit 0a9d5e7

Browse files
authored
Update to 2022a. (#27)
* Improvements for more consistent TAI-to-UTC-and-back time conversions. * Update to 2022a.
1 parent 0d36ef5 commit 0a9d5e7

10 files changed

Lines changed: 563 additions & 503 deletions

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ Two alternate large timezone definition sets, of approximately 280K each, are av
6969
- [Leap Seconds, TAI, and Julian Dates](#leap-seconds-tai-and-julian-dates)
7070
- [Leap second time values](#leap-second-time-values)
7171
- [TAI field values](#tai-field-values)
72+
- [Converting from UT/UTC to TAI, and back again](#converting-from-ututc-to-tai-and-back-again)
7273
- [Astronomical `DateAndTime` fields](#astronomical-dateandtime-fields)
7374
- [`epochMillis`, `utcMillis`, and `taiMillis` getters/setters](#epochmillis-utcmillis-and-taimillis-getterssetters)
7475
- [Sorting and comparison with TAI and non-TAI `DateTime` instances](#sorting-and-comparison-with-tai-and-non-tai-datetime-instances)
@@ -956,6 +957,12 @@ Note that this only works for defined leap seconds. `new DateTime('2021-04-15 23
956957

957958
You can `add` and `subtract` TAI quantities using the following fields: `MILLI_TAI`, `SECOND_TAI`, `MINUTE_TAI`, `HOUR_TAI`, and `DAY_TAI`, as provided by the `DateTimeField` enum, or their string equivalents (`'milli_tai'`, `'millis_tai'`, `'millisecond_tai'`, `'milliseconds_tai'`, `'second_tai'`... etc.).
958959

960+
### Converting from UT/UTC to TAI, and back again
961+
962+
**@tubular/time** `DateTime` instances maintain UT/UTC time using integer millisecond values (sometimes along with an ancillary integer count of milliseconds during leap seconds). Starting with version 3.8.0 of **@tubular/time**, `DateTime` TAI time values, likewise measured in milliseconds, can be integer or non-integer values. This difference is because integer TAI values, as previously used, do not have a unique one-to-one correspondence with UT/UTC integer values. Without fractional precision for TAI, a UT/UTC value converted to TAI, then converted back to UT/UTC, would not reliably be restored to its original value.
963+
964+
Over the range of time starting from January 1, 1958, up until roughly six months beyond present realtime, time is maintained specifically as UTC (not UT1 or UT1/UTC transitional) and UTC integer milliseconds are reliably converted to TAI integer milliseconds.
965+
959966
### Astronomical `DateAndTime` fields
960967

961968
* `jde`: Julian Date (ephemeris) — Time measured in fixed-length days of dynamical time from noon, January 1, 4713 BCE (-4712-01-01T12:00) Terrestrial Dynamical Time (TDT), defined to be exactly 32.184 seconds ahead of TAI.

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tubular/time",
3-
"version": "3.7.5",
3+
"version": "3.8.1",
44
"description": "Date/time, IANA timezones, leap seconds, TAI/UTC conversions, calendar with settable Julian/Gregorian switchover",
55
"main": "dist/cjs/index.js",
66
"module": "dist/fesm2015/index.js",

0 commit comments

Comments
 (0)