Ordinal
represents a bounded value for days, which ranges between 1 and 31.
Equations
Equations
- Std.Time.Day.instOfNatOrdinal = inferInstanceAs (OfNat (Std.Time.Internal.Bounded.LE 1 (1 + ↑30)) n)
Equations
Equations
Equations
- Std.Time.Day.instInhabitedOrdinal = { default := 1 }
Equations
Offset
represents an offset in days. It is defined as an Int
with a base unit of 86400
(the number of seconds in a day).
Equations
Instances For
- Std.Time.DateTime.instHAddOffset
- Std.Time.DateTime.instHSubOffset
- Std.Time.Day.instLawfulEqOrdOffset
- Std.Time.Day.instOfNatOffset
- Std.Time.Day.instOffsetAdd
- Std.Time.Day.instOffsetInhabited
- Std.Time.Day.instOffsetLE
- Std.Time.Day.instOffsetLT
- Std.Time.Day.instOffsetNeg
- Std.Time.Day.instOffsetRepr
- Std.Time.Day.instOffsetSub
- Std.Time.Day.instOffsetToString
- Std.Time.Day.instOrdOffset
- Std.Time.Day.instTransOrdOffset
- Std.Time.Duration.instCoeOffset_5
- Std.Time.Duration.instHAddOffset
- Std.Time.Duration.instHSubOffset
- Std.Time.PlainDate.instHAddOffset
- Std.Time.PlainDate.instHSubOffset
- Std.Time.PlainDateTime.instHAddOffset
- Std.Time.PlainDateTime.instHSubOffset
- Std.Time.Timestamp.instHAddOffset
- Std.Time.Timestamp.instHSubOffset
- Std.Time.ZonedDateTime.instHAddOffset
- Std.Time.ZonedDateTime.instHSubOffset
- Std.Time.instHAddOffsetOffset_10
- Std.Time.instHAddOffsetOffset_16
- Std.Time.instHAddOffsetOffset_22
- Std.Time.instHAddOffsetOffset_28
- Std.Time.instHAddOffsetOffset_30
- Std.Time.instHAddOffsetOffset_31
- Std.Time.instHAddOffsetOffset_32
- Std.Time.instHAddOffsetOffset_33
- Std.Time.instHAddOffsetOffset_34
- Std.Time.instHAddOffsetOffset_35
- Std.Time.instHAddOffsetOffset_4
- Std.Time.instHAddOffsetOffset_41
- Std.Time.instHAddOffset_5
- Std.Time.instHSubOffsetOffset_10
- Std.Time.instHSubOffsetOffset_16
- Std.Time.instHSubOffsetOffset_22
- Std.Time.instHSubOffsetOffset_28
- Std.Time.instHSubOffsetOffset_30
- Std.Time.instHSubOffsetOffset_31
- Std.Time.instHSubOffsetOffset_32
- Std.Time.instHSubOffsetOffset_33
- Std.Time.instHSubOffsetOffset_34
- Std.Time.instHSubOffsetOffset_35
- Std.Time.instHSubOffsetOffset_4
- Std.Time.instHSubOffsetOffset_41
- Std.Time.instHSubOffset_5
Equations
- Std.Time.Day.instOfNatOffset = { ofNat := Std.Time.Internal.UnitVal.ofNat n }
Equations
Equations
Equations
Creates an Ordinal
from an integer, ensuring the value is within bounds.
Equations
- Std.Time.Day.Ordinal.ofInt data h = Std.Time.Internal.Bounded.LE.mk data h
OfYear
represents the day ordinal within a year, which can be bounded between 1 and 365 or 366,
depending on whether it's a leap year.
Equations
- Std.Time.Day.Ordinal.OfYear leap = Std.Time.Internal.Bounded.LE 1 (Int.ofNat (if leap = true then 366 else 365))
Equations
- Std.Time.Day.Ordinal.instReprOfYear = { reprPrec := fun (r : Std.Time.Day.Ordinal.OfYear leap) (p : Nat) => reprPrec r.val p }
Equations
- Std.Time.Day.Ordinal.instToStringOfYear = { toString := fun (r : Std.Time.Day.Ordinal.OfYear leap) => toString r.val }
Equations
- Std.Time.Day.Ordinal.instDecidableEqOfYear = inferInstanceAs (DecidableEq (Std.Time.Internal.Bounded.LE 1 (Int.ofNat (if leap = true then 366 else 365))))
Equations
- Std.Time.Day.Ordinal.instOrdOfYear = inferInstanceAs (Ord (Std.Time.Internal.Bounded.LE 1 (Int.ofNat (if leap = true then 366 else 365))))
Creates an ordinal for a specific day within the year, ensuring that the provided day (data
)
is within the valid range for the year, which can be 1 to 365 or 366 for leap years.
Equations
Equations
- Std.Time.Day.Ordinal.instOfNatOfYear = inferInstanceAs (OfNat (Std.Time.Internal.Bounded.LE 1 (1 + ↑365)) n)
- Std.Time.Day.Ordinal.instOfNatOfYear = inferInstanceAs (OfNat (Std.Time.Internal.Bounded.LE 1 (1 + ↑364)) n)
Equations
- Std.Time.Day.Ordinal.instInhabitedOfYear = { default := ⟨1, ⋯⟩ }
Creates an ordinal from a natural number, ensuring the number is within the valid range for days of a month (1 to 31).
Equations
- Std.Time.Day.Ordinal.ofNat data h = Std.Time.Internal.Bounded.LE.ofNat' data h
Creates an Offset
from a natural number.
Equations
- Std.Time.Day.Offset.ofNat data = { val := ↑data }
Creates an Offset
from an integer.
Equations
- Std.Time.Day.Offset.ofInt data = { val := data }
Convert Day.Offset
into Nanosecond.Offset
.
Equations
- days.toNanoseconds = Std.Time.Internal.UnitVal.mul days 86400000000000
Convert Nanosecond.Offset
into Day.Offset
.
Equations
- Std.Time.Day.Offset.ofNanoseconds ns = Std.Time.Internal.UnitVal.ediv ns 86400000000000
Convert Day.Offset
into Millisecond.Offset
.
Equations
- days.toMilliseconds = Std.Time.Internal.UnitVal.mul days 86400000
Convert Millisecond.Offset
into Day.Offset
.
Equations
- Std.Time.Day.Offset.ofMilliseconds ms = Std.Time.Internal.UnitVal.ediv ms 86400000
Convert Day.Offset
into Second.Offset
.
Equations
- days.toSeconds = Std.Time.Internal.UnitVal.mul days 86400
Convert Second.Offset
into Day.Offset
.
Equations
- Std.Time.Day.Offset.ofSeconds secs = Std.Time.Internal.UnitVal.ediv secs 86400
Convert Day.Offset
into Minute.Offset
.
Equations
- days.toMinutes = Std.Time.Internal.UnitVal.mul days 1440
Convert Minute.Offset
into Day.Offset
.
Equations
- Std.Time.Day.Offset.ofMinutes minutes = Std.Time.Internal.UnitVal.ediv minutes 1440
Convert Day.Offset
into Hour.Offset
.
Equations
- days.toHours = Std.Time.Internal.UnitVal.mul days 24
Convert Hour.Offset
into Day.Offset
.
Equations
- Std.Time.Day.Offset.ofHours hours = Std.Time.Internal.UnitVal.ediv hours 24