Convert to proleptic Gregorian calendar.
Equations
- Time.toGregorian date = Time.ordinalDateToDate (Time.toOrdinalDate date)
Instances For
Convert from proleptic Gregorian calendar.
Equations
Instances For
Convert from proleptic Gregorian calendar. Invalid values will be clipped to the correct range, month first, then day.
Equations
- Time.fromGregorianClipped year month day = Time.fromOrdinalDate (Time.monthAndDayToDayOfYear year month day)
Instances For
Convert from proleptic Gregorian calendar. Invalid values give result none.
Equations
- Time.fromGregorianValid year month day = do let d ← Time.monthAndDayToDayOfYearValid year month day some (Time.fromOrdinalDate d)
Instances For
Equations
Instances For
The number of days in a given month according to the proleptic Gregorian calendar.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Add months, with days past the last day of the month clipped to the last day. For instance, 2005-01-30 + 1 month = 2005-02-28.
Equations
- Time.Gregorian.addMonthsClip n day = match Time.Gregorian.addMonths n day with | (y, m, d) => Time.fromGregorianClipped y m d
Instances For
Add months, with days past the last day of the month rolling over to the next month. For instance, 2005-01-30 + 1 month = 2005-03-02.
Equations
- Time.Gregorian.addMonthsRollOver n day = match Time.Gregorian.addMonths n day with | (y, m, d) => Time.Day.addDays (d - 1) (Time.fromGregorianClipped y m 1)
Instances For
Add years, matching month and day, with Feb 29th clipped to Feb 28th if necessary. For instance, 2004-02-29 + 2 years = 2006-02-28.
Equations
- Time.Gregorian.addYearsClip n day = Time.Gregorian.addMonthsClip (n * 12) day
Instances For
Add years, matching month and day, with Feb 29th rolled over to Mar 1st if necessary. -- For instance, 2004-02-29 + 2 years = 2006-03-01.
Equations
- Time.Gregorian.addYearsRollOver n day = Time.Gregorian.addMonthsRollOver (n * 12) day
Instances For
Add months (clipped to last day), then add days
Equations
- Time.Gregorian.addDurationClip cd day = Time.Day.addDays cd.days (Time.Gregorian.addMonthsClip cd.months day)
Instances For
Add months (rolling over to next month), then add days
Equations
- Time.Gregorian.addDurationRollOver cd day = Time.Day.addDays cd.days (Time.Gregorian.addMonthsRollOver cd.months day)
Instances For
Calendrical difference, with as many whole months as possible
Equations
- One or more equations did not get rendered due to their size.
Instances For
Calendrical difference, with as many whole months as possible.
Equations
- One or more equations did not get rendered due to their size.