Equations
- Std.Time.Day.instOfNatOrdinal = inferInstanceAs (OfNat (Std.Time.Internal.Bounded.LE 1 (1 + ↑30)) n)
Equations
- Std.Time.Day.instDecidableLeOrdinal = inferInstanceAs (Decidable (x.val ≤ y.val))
Equations
- Std.Time.Day.instInhabitedOrdinal = { default := 1 }
Equations
- Std.Time.Day.instOffsetRepr = Std.Time.Internal.UnitVal.instRepr
Equations
- Std.Time.Day.instOffsetNeg = Std.Time.Internal.UnitVal.instNeg
Equations
- Std.Time.Day.instOffsetLE = Std.Time.Internal.UnitVal.instLE
Equations
- Std.Time.Day.instOffsetLT = Std.Time.Internal.UnitVal.instLT
Equations
- Std.Time.Day.instDecidableLeOffset = inferInstanceAs (Decidable (x.val ≤ y.val))
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.
Instances For
@[inline]
def
Std.Time.Day.Ordinal.OfYear.ofNat
{leap : Bool}
(data : Nat)
(h : data ≥ 1 ∧ data ≤ if leap = true then 366 else 365 := by decide)
:
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
Instances For
instance
Std.Time.Day.Ordinal.instOfNatOfYear
{leap : Bool}
{n : Nat}
:
OfNat (Std.Time.Day.Ordinal.OfYear leap) n
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, ⋯⟩ }
@[inline]
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
Instances For
def
Std.Time.Day.Ordinal.OfYear.toOffset
{leap : Bool}
(ofYear : Std.Time.Day.Ordinal.OfYear leap)
:
Converts an OfYear
ordinal to a Offset
.
Instances For
@[inline]
Converts an Offset
to an Ordinal
.
Equations
- off.toOrdinal h = Std.Time.Internal.Bounded.LE.mk off.val h
Instances For
@[inline]
Creates an Offset
from a natural number.
Equations
- Std.Time.Day.Offset.ofNat data = { val := ↑data }
Instances For
@[inline]
Convert Nanosecond.Offset
into Day.Offset
.
Equations
- Std.Time.Day.Offset.ofNanoseconds ns = Std.Time.Internal.UnitVal.ediv ns 86400000000000
Instances For
@[inline]
Convert Day.Offset
into Second.Offset
.
Equations
- days.toSeconds = Std.Time.Internal.UnitVal.mul days 86400
Instances For
@[inline]
Convert Second.Offset
into Day.Offset
.
Equations
- Std.Time.Day.Offset.ofSeconds secs = Std.Time.Internal.UnitVal.ediv secs 86400
Instances For
@[inline]
Convert Hour.Offset
into Day.Offset
.
Equations
- Std.Time.Day.Offset.ofHours hours = Std.Time.Internal.UnitVal.ediv hours 24