Documentation

Std.Time.Date.Unit.Month

Quarter represents a value between 1 and 4, inclusive, corresponding to the four quarters of a year.

Equations
@[inline]

Creates an Offset from a natural number.

Equations
@[inline]

Creates an Offset from an integer.

Equations
@[inline]

The ordinal value representing the month of January.

Equations
@[inline]

The ordinal value representing the month of February.

Equations
@[inline]

The ordinal value representing the month of March.

Equations
@[inline]

The ordinal value representing the month of April.

Equations
@[inline]

The ordinal value representing the month of May.

Equations
@[inline]

The ordinal value representing the month of June.

Equations
@[inline]

The ordinal value representing the month of July.

Equations
@[inline]

The ordinal value representing the month of August.

Equations
@[inline]

The ordinal value representing the month of September.

Equations
@[inline]

The ordinal value representing the month of October.

Equations
@[inline]

The ordinal value representing the month of November.

Equations
@[inline]

The ordinal value representing the month of December.

Equations
@[inline]

Converts a Ordinal into a Offset.

Equations
@[inline]
def Std.Time.Month.Ordinal.ofInt (data : Int) (h : 1 data data 12) :

Creates an Ordinal from an integer, ensuring the value is within bounds.

Equations
@[inline]
def Std.Time.Month.Ordinal.ofNat (data : Nat) (h : data 1 data 12 := by decide) :

Creates an Ordinal from a Nat, ensuring the value is within bounds.

Equations
@[inline]

Converts a Ordinal into a Nat.

Equations
@[inline]

Creates an Ordinal from a Fin, ensuring the value is within bounds, if its 0 then its converted to 1.

Equations

Transforms Month.Ordinal into Second.Offset.

Equations
  • One or more equations did not get rendered due to their size.

Gets the number of days in a month.

Equations
  • One or more equations did not get rendered due to their size.
theorem Std.Time.Month.Ordinal.days_gt_27 (leap : Bool) (i : Ordinal) :
days leap i > 27

Returns the number of days until the month.

Equations
  • One or more equations did not get rendered due to their size.
theorem Std.Time.Month.Ordinal.cumulativeDays_le (leap : Bool) (month : Ordinal) :
cumulativeDays leap month 0 cumulativeDays leap month 334 + if leap = true then 1 else 0
theorem Std.Time.Month.Ordinal.difference_eq {leap : Bool} {month : Ordinal} (p : month.val 11) :
let next := (Internal.Bounded.LE.truncateTop month p).addTop 1 ; (cumulativeDays leap next).val = (cumulativeDays leap month).val + (days leap month).val
@[reducible, inline]
abbrev Std.Time.Month.Ordinal.Valid (leap : Bool) (month : Ordinal) (day : Day.Ordinal) :

Checks if a given day is valid for the specified month and year. For example, 29/02 is valid only if the year is a leap year.

Equations
@[inline]

Clips the day to be within the valid range.

Equations
theorem Std.Time.Month.Ordinal.valid_clipDay {leap : Bool} {month : Ordinal} {day : Day.Ordinal} :
Valid leap month (clipDay leap month day)

Proves that every value provided by a clipDay is a valid day in a year.