Add datetime/timedelta classes #6
Draft
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.
This PR adds classes for representing datetimes & timedeltas
TimeDeltarepresents the signed duration between two timepoints with picosecond resolution. It supports integer-like arithmetic operations and can be converted to & fromstd::chrono::duration. Internally, it stores a 128-bit integer tick count, allowing for representation of an extremely wide range of values without loss of precision.GPSTimeis a datetime in the GPS time system. Unlike UTC time, GPS time is a continuous linear time scale -- leap seconds are never inserted. Internally,GPSTimestores a 128-bit integer timestamp with a picosecond tick interval.UTCTime(not yet implemented) represents a datetime in the UTC time system. Leap second augmentations are occasionally applied to account for the difference between time measured by atomic clocks and observed solar time. As a result, the time scale is discontinuous and forecasting into the future may be inaccurate due to the unpredictable timing of UTC leap seconds.UTCTimeparses the system's IANA timezone database to extract leap second information.The implementation relies heavily on the
<chrono>library as well as Howard Hinnant'sdatelibrary (which was added to the STL in C++20) for the underlying datetime conversions and arithmetic. In addition, it usesabseil-cpp'sint128type.