difference static method
Subtracts one zoned date and time from another, returning an elapsed duration.
This is equivalent to start.ToInstant().timeUntil(end.ToInstant())
; in particular:
-
The two values can use different calendar systems
-
The two values can be in different time zones
-
The two values can have different UTC offsets
-
end
: The zoned date and time value to subtract from; if this is later thanstart
then the result will be positive. -
start
: The zoned date and time to subtract fromend
.
Returns: The elapsed duration from start
to end
.
Implementation
static Time difference(ZonedDateTime end, ZonedDateTime start) => end.timeSince(start);