Skip to main content
Version: Java (Groovy)

toExcelTime

The toExcelTime method converts a date-time to an Excel time represented as a double.

Syntax

toExcelTime(instant, timeZone)
toExcelTime(dateTime)

Parameters

ParameterTypeDescription
instantInstant

The Instant to convert.

timeZoneZoneId

The time zone.

dateTimeZonedDateTime

The zoned date-time to convert.

Returns

An Excel time.

Examples

println toExcelTime(now(), timeZone("UTC"))