Skip to main content
Version: Java (Groovy)

epochAutoToZonedDateTime

epochAutoToZonedDateTime converts an offset from the Epoch to a ZonedDateTime.

Syntax

epochAutoToZonedDateTime(epochOffset, timeZone)

Parameters

ParameterTypeDescription
epochOffsetlong

The time offset from the Epoch. Can be in milliseconds, microseconds, or nanoseconds. Expected date ranges are used to infer the units for the offset.

timeZoneZoneId

The time zone.

Returns

A ZonedDateTime.

Examples

offset = 164000
tz = timeZone("UTC")

zdt = epochAutoToZonedDateTime(offset, tz)
print(zdt)
offset = 164000000
tz = timeZone("UTC")

zdt = epochAutoToZonedDateTime(offset, tz)
print(zdt)