Package io.delta.kernel.internal.util
Class TimestampUtils
Object
io.delta.kernel.internal.util.TimestampUtils
Utilities for timestamp conversions that avoid overflow issues.
Note: ChronoUnit.MICROS.between() internally computes (seconds * 1_000_000_000)
/ 1000, where the intermediate nanoseconds value overflows for timestamps beyond ~292 years from
epoch. These methods compute seconds * 1_000_000 directly to avoid overflow.
-
Method Summary
Modifier and TypeMethodDescriptionstatic longtoEpochMicros(Instant instant) Converts an Instant to microseconds since epoch.static longtoEpochMicros(LocalDateTime dateTime) Converts a LocalDateTime (interpreted as UTC) to microseconds since epoch.static longtoEpochMicros(OffsetDateTime dateTime) Converts an OffsetDateTime to microseconds since epoch.
-
Method Details
-
toEpochMicros
Converts an Instant to microseconds since epoch. -
toEpochMicros
Converts an OffsetDateTime to microseconds since epoch. -
toEpochMicros
Converts a LocalDateTime (interpreted as UTC) to microseconds since epoch.
-