A wall-clock time is what a clock shows in a given timezone: the local civil time at some point in
time. It is stored as a Duration since 1970-01-01T00:00:00 in local time, equivalent to a
PlainDateTime packed into a single offset, which makes arithmetic straightforward.
Every timezone induces a correspondence between Timestamp and WallTime: interpreting a
Timestamp in a timezone yields the WallTime (what a clock in that timezone reads at that
instant), and resolving a WallTime in a timezone yields the Timestamp (the absolute instant the
clock reading refers to).
- val : Duration
Duration since
1970-01-01T00:00:00in local (civil) time.
Instances For
Equations
- Std.Time.instReprWallTime.repr x✝ prec✝ = Std.Format.bracket "{ " (Std.Format.nil ++ Std.Format.text "val" ++ Std.Format.text " := " ++ (Std.Format.nest 7 (repr x✝.val)).group) " }"
Instances For
Equations
- Std.Time.instReprWallTime = { reprPrec := Std.Time.instReprWallTime.repr }
Equations
Equations
- Std.Time.instLEWallTime = { le := fun (x y : Std.Time.WallTime) => x.val ≤ y.val }
Equations
- Std.Time.instLTWallTime = { lt := fun (x y : Std.Time.WallTime) => x.val < y.val }
Equations
- Std.Time.instOrdWallTime = { compare := compareOn fun (x : Std.Time.WallTime) => x.val }
Equations
- Std.Time.instToStringWallTime = { toString := fun (s : Std.Time.WallTime) => toString s.val.toSeconds }
Equations
- Std.Time.instReprWallTime_1 = { reprPrec := fun (s : Std.Time.WallTime) => Repr.addAppParen (Std.Format.text "WallTime.ofNanoseconds " ++ repr s.val.toNanoseconds) }
Creates a WallTime from a Duration. The epoch is 1970-01-01 00:00:00 in local
(civil) time, not UTC.
Equations
- Std.Time.WallTime.ofDuration duration = { val := duration }
Instances For
Creates a WallTime from a Second.Offset. The epoch is 1970-01-01 00:00:00 in local
(civil) time, not UTC.
Equations
- Std.Time.WallTime.ofSeconds secs = { val := Std.Time.Duration.ofSeconds secs }
Instances For
Creates a WallTime from a Nanosecond.Offset. The epoch is 1970-01-01 00:00:00 in local
(civil) time, not UTC.
Equations
- Std.Time.WallTime.ofNanoseconds nanos = { val := Std.Time.Duration.ofNanoseconds nanos }
Instances For
Converts a WallTime to a Second.Offset. The epoch is 1970-01-01 00:00:00 in local
(civil) time, not UTC.
Instances For
Converts a WallTime to a Minute.Offset. The epoch is 1970-01-01 00:00:00 in local
(civil) time, not UTC.
Instances For
Converts a WallTime to a Day.Offset. The epoch is 1970-01-01 00:00:00 in local
(civil) time, not UTC.
Instances For
Creates a WallTime from a Millisecond.Offset. The epoch is 1970-01-01 00:00:00 in local
(civil) time, not UTC.
Equations
- Std.Time.WallTime.ofMilliseconds milli = { val := Std.Time.Duration.ofNanoseconds milli.toNanoseconds }
Instances For
Converts a WallTime to a Millisecond.Offset. The epoch is 1970-01-01 00:00:00 in local
(civil) time, not UTC.
Equations
Instances For
Adds a Nanosecond.Offset to the given WallTime.
Equations
- t.addNanoseconds s = { val := t.val + Std.Time.Duration.ofNanoseconds s }
Instances For
Subtracts a Nanosecond.Offset from the given WallTime.
Equations
- t.subNanoseconds s = { val := t.val - Std.Time.Duration.ofNanoseconds s }
Instances For
Adds a Second.Offset to the given WallTime.
Equations
- t.addSeconds s = { val := t.val + Std.Time.Duration.ofSeconds s }
Instances For
Subtracts a Second.Offset from the given WallTime.
Equations
- t.subSeconds s = { val := t.val - Std.Time.Duration.ofSeconds s }
Instances For
Adds a Minute.Offset to the given WallTime.
Equations
- t.addMinutes m = { val := t.val + (Std.Time.Duration.ofSeconds ∘ Std.Time.Minute.Offset.toSeconds) m }
Instances For
Subtracts a Minute.Offset from the given WallTime.
Equations
- t.subMinutes m = { val := t.val - (Std.Time.Duration.ofSeconds ∘ Std.Time.Minute.Offset.toSeconds) m }
Instances For
Adds an Hour.Offset to the given WallTime.
Equations
- t.addHours h = { val := t.val + (Std.Time.Duration.ofSeconds ∘ Std.Time.Hour.Offset.toSeconds) h }
Instances For
Subtracts an Hour.Offset from the given WallTime.
Equations
- t.subHours h = { val := t.val - (Std.Time.Duration.ofSeconds ∘ Std.Time.Hour.Offset.toSeconds) h }
Instances For
Adds a Day.Offset to the given WallTime.
Equations
- t.addDays d = { val := t.val + (Std.Time.Duration.ofSeconds ∘ Std.Time.Day.Offset.toSeconds) d }
Instances For
Subtracts a Day.Offset from the given WallTime.
Equations
- t.subDays d = { val := t.val - (Std.Time.Duration.ofSeconds ∘ Std.Time.Day.Offset.toSeconds) d }
Instances For
Adds a Week.Offset to the given WallTime.
Equations
- t.addWeeks d = { val := t.val + (Std.Time.Duration.ofSeconds ∘ Std.Time.Day.Offset.toSeconds ∘ Std.Time.Week.Offset.toDays) d }
Instances For
Subtracts a Week.Offset from the given WallTime.
Equations
- t.subWeeks d = { val := t.val - (Std.Time.Duration.ofSeconds ∘ Std.Time.Day.Offset.toSeconds ∘ Std.Time.Week.Offset.toDays) d }
Instances For
Converts a WallTime to a Duration. The epoch is 1970-01-01 00:00:00 in local
(civil) time, not UTC.
Equations
- wt.toDuration = wt.val
Instances For
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
- Std.Time.WallTime.instHSubDuration_1 = { hSub := fun (x y : Std.Time.WallTime) => x.val - y.val }