Hi,

Last year, I extended ZTimestamp with a default nanosecond precision (it 
previously had whole second precision). This makes it a more complete 
replacement for DateAndTime.

https://github.com/svenvc/ztimestamp
https://github.com/svenvc/ztimestamp/commit/de6c5a670ed0c6cb18894b4917383dd9d1dbe503

The goals of ZTimestamp are to be simpler and more efficient (both faster and 
more compact). A ZTimestamp instance occupies half the space of a DateAndTime 
instance, its two slots being SmallIntegers. Back in the 32-bit days, the 
seconds since midnight field was too small for nanoseconds. Now, 64-bit is the 
default and there is enough room and no speed penalty for working with 
nanoseconds since midnight.

In casual use, you won't see much of a difference, apart from the added detail:

ZTimestamp now. "2022-01-27T09:21:20.528695Z"

There are ways to convert to the older precision:

ZTimestamp now truncated.
ZTimestamp now rounded.
ZTimestamp nowTruncated.

Obviously, other methods and classes now support this added precision (like 
ZTimestampFormat).

If you load or depend on tag/release v25 you get the latest version before this 
major change.

If you encounter any problems please let me know.

Sven

Reply via email to