Repository navigation
Conversation
The inverse lookup compared the TT-shifted ns count against UTC leap-second thresholds, so instants within the leap offset before each threshold read back one second early. A TT2000 inside an inserted leap second now maps onto the following UTC second, as cdflib does.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
Benchmark Results (Julia v1)Time benchmarks
Memory benchmarks
|
Beforerr
force-pushed
the
timestamp
branch
3 times, most recently
from
October 2, 2026 17:21
0cf666f to
14fbc19
Compare
Beforerr
force-pushed
the
timestamp
branch
6 times, most recently
from
October 2, 2026 18:00
c505cf9 to
40959c2
Compare
UTC -> TT2000 is injective, TT2000 -> UTC folds each inserted leap second
onto the following second, so mixed comparisons and differences are done
in the CDF type. Timestamp{Nanosecond} (Durations.jl) backs TT2000
parsing, printing and calendar fields; Epoch and Epoch16 span years
0-9999 and keep DateTime for those.
Also: comparison across CDF epoch types, Epoch16 ordering and
Epoch16 ± Period, Date/Time/days accessors, TT2000(::DateTime) up to
2292, leap-second lookup on the nanosecond count (crashed just below
1972), ISTP FILLVAL display for TT2000 and Epoch16.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two commits.
fix: TT2000 to DateTime off by 1 s before each leap second. The inverse lookup compared the TT-shifted count against UTC leap-second thresholds, so for the ~30 s before each leap second since 1972, reads came back 1 s early (e.g.
DateTime(TT2000(DateTime("2016-12-31T23:59:30")))gave23:59:29). Regression values come fromcdflib.cdfepoch.compute_tt2000.feat!: promote DateTime/Timestamp to the CDF epoch types (adds Durations.jl 1.4 for
Timestamp).Date,DateTimeandTimestamppromote toTT2000/Epoch16/Epochrather than the epoch promoting toDateTime. UTC -> TT2000 is injective, while TT2000 -> UTC folds each inserted leap second onto the following second, so comparing in UTC would equate distinct instants and under-count differences across a leap second. A TT2000 0.4 ms afterDateTime(2020)no longer compares==to it.Timestamp{P}(x)/convert(Timestamp{P}, x)for all CDF epochs.TT2000parses, prints and exposes calendar fields to the nanosecond throughTimestamp{Nanosecond}.EpochandEpoch16span years 0-9999, beyondTimestamp{Nanosecond}(1677-2262), and keepDateTimefor calendar fields and printing.DateTime(x)for TT2000/Epoch16 floors to the millisecond (Epoch16 used to round).Epoch16ordering and± Period;Date,Timeand day-based accessors.Fixes found while probing:
DateTimethrew for instants within 0.5 ms before 1972-01-01 and used the next day's offset within 0.5 ms before earlier midnights.TT2000(::DateTime)covers the full TT2000 range (to 2292).FILLVALdisplay: TT2000 uses the ISTP fill (typemin(Int64)) rather than9999; the Epoch16 fill no longer throws.Known limits: comparing a TT2000 with a
DateTimeoutside the TT2000 range throws;stringof a TT2000 in 2262-2292 throws;floorof an instant inside a leap second lands on the following second.Breaking (promotion and equality semantics). CDFDatasets' tests pass locally against this branch; downstream compat needs widening on release.