14.7.1 Time
class | ||||||
|
Represents a time relative to an unspecified date and in an unspecified
time zone.
The date.Time class privately implements Comparable, so date.Time instances can be compared with operators like < and >. A date.Time instance is serializable.
> tm
Time(~hour: 5, ~minute: 45, ~second: 0, ~nanosecond: 0)
"05:45:00"
#true
Uses the system clock via system.milliseconds to get the
current time and using the operating system’s facilities to get a time
of day relative to either the current time zone (when local is
true) or UTC (when local is false).
Uses operating system facilities to convert a number of seconds since
the epoch to a time of day relative to either the current time
zone (when local is true) or UTC (when local is
false).
If the operating system reports a time within a leap second, then the reported time is the end of the preceding second.
> date.Time.from_seconds(0, ~local: #false)
Time(~hour: 0, ~minute: 0, ~second: 0, ~nanosecond: 0)
method | |||
|
> def tm1 = date.Time(~hour: 5, ~minute: 45, ~second: 1, ~nanosecond: 70000)
"05:45:01"
"05:45:01.000070000"
"05:45:01.000070"