Represents a date and time with components for Year, Month, Day, Hour, Minute, Second, and Nanosecond.
Instances For
Equations
Equations
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Std.Time.instOrdPlainDateTime = { compare := compareLex (compareOn fun (x : Std.Time.PlainDateTime) => x.date) (compareOn fun (x : Std.Time.PlainDateTime) => x.time) }
Converts a PlainDateTime to a WallTime.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Converts a WallTime to a PlainDateTime.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns the local (civil) date of the PlainDateTime as a Day.Offset relative to 1970-01-01.
Equations
- pdt.toEpochDay = pdt.date.toEpochDay
Instances For
Converts the number of days relative to 1970-01-01 as a PlainDateTime.
Equations
- Std.Time.PlainDateTime.ofEpochDay days time = { date := Std.Time.PlainDate.ofEpochDay days, time := time }
Instances For
Sets the PlainDateTime to the specified Weekday.
Equations
- dt.withWeekday desiredWeekday = { date := dt.date.withWeekday desiredWeekday, time := dt.time }
Instances For
Creates a new PlainDateTime by adjusting the day of the month to the given days value, with any
out-of-range days clipped to the nearest valid date.
Equations
- dt.withDaysClip days = { date := Std.Time.PlainDate.ofYearMonthDayClip dt.date.year dt.date.month days, time := dt.time }
Instances For
Creates a new PlainDateTime by adjusting the day of the month to the given days value, with any
out-of-range days rolled over to the next month or year as needed.
Equations
- dt.withDaysRollOver days = { date := Std.Time.PlainDate.rollOver dt.date.year dt.date.month days, time := dt.time }
Instances For
Creates a new PlainDateTime by adjusting the month to the given month value, with any
out-of-range days clipped to the nearest valid date.
Equations
- dt.withMonthClip month = { date := Std.Time.PlainDate.ofYearMonthDayClip dt.date.year month dt.date.day, time := dt.time }
Instances For
Creates a new PlainDateTime by adjusting the month to the given month value.
The day is rolled over to the next valid month if necessary.
Equations
- dt.withMonthRollOver month = { date := Std.Time.PlainDate.rollOver dt.date.year month dt.date.day, time := dt.time }
Instances For
Creates a new PlainDateTime by adjusting the year to the given year value. The month and day
remain unchanged, with any out-of-range days clipped to the nearest valid date.
Equations
- dt.withYearClip year = { date := Std.Time.PlainDate.ofYearMonthDayClip year dt.date.month dt.date.day, time := dt.time }
Instances For
Creates a new PlainDateTime by adjusting the year to the given year value. The month and day are rolled
over to the next valid month and day if necessary.
Equations
- dt.withYearRollOver year = { date := Std.Time.PlainDate.rollOver year dt.date.month dt.date.day, time := dt.time }
Instances For
Creates a new PlainDateTime by adjusting the hour component of its time to the given value.
Equations
Instances For
Creates a new PlainDateTime by adjusting the minute component of its time to the given value.
Equations
Instances For
Creates a new PlainDateTime by adjusting the second component of its time to the given value.
Equations
Instances For
Creates a new PlainDateTime by adjusting the milliseconds component inside the nano component of its time to the given value.
Equations
- dt.withMilliseconds millis = { date := dt.date, time := dt.time.withMilliseconds millis }
Instances For
Creates a new PlainDateTime by adjusting the nano component of its time to the given value.
Equations
- dt.withNanoseconds nano = { date := dt.date, time := dt.time.withNanoseconds nano }
Instances For
Adds a Month.Offset to a PlainDateTime, adjusting the day to the last valid day of the resulting
month.
Equations
- dt.addMonthsClip months = { date := dt.date.addMonthsClip months, time := dt.time }
Instances For
Subtracts Month.Offset from a PlainDateTime, it clips the day to the last valid day of that month.
Equations
- dt.subMonthsClip months = { date := dt.date.subMonthsClip months, time := dt.time }
Instances For
Adds a Month.Offset to a PlainDateTime, rolling over excess days to the following month if needed.
Equations
- dt.addMonthsRollOver months = { date := dt.date.addMonthsRollOver months, time := dt.time }
Instances For
Subtracts a Month.Offset from a PlainDateTime, adjusting the day to the last valid day of the
resulting month.
Equations
- dt.subMonthsRollOver months = { date := dt.date.subMonthsRollOver months, time := dt.time }
Instances For
Adds a Month.Offset to a PlainDateTime, rolling over excess days to the following month if needed.
Equations
- dt.addYearsRollOver years = { date := dt.date.addYearsRollOver years, time := dt.time }
Instances For
Subtracts a Month.Offset from a PlainDateTime, rolling over excess days to the following month if
needed.
Equations
- dt.addYearsClip years = { date := dt.date.addYearsClip years, time := dt.time }
Instances For
Subtracts a Year.Offset from a PlainDateTime, this function rolls over any excess days into the
following month.
Equations
- dt.subYearsRollOver years = { date := dt.date.subYearsRollOver years, time := dt.time }
Instances For
Subtracts a Year.Offset from a PlainDateTime, adjusting the day to the last valid day of the
resulting month.
Equations
- dt.subYearsClip years = { date := dt.date.subYearsClip years, time := dt.time }
Instances For
Adds a Nanosecond.Offset to a PlainDateTime, adjusting the seconds, minutes, hours, and date if the nanoseconds overflow.
Equations
- dt.addNanoseconds nanos = Std.Time.PlainDateTime.ofWallTime (dt.toWallTime + nanos)
Instances For
Subtracts a Nanosecond.Offset from a PlainDateTime, adjusting the seconds, minutes, hours, and date if the nanoseconds underflow.
Equations
- dt.subNanoseconds nanos = dt.addNanoseconds (-nanos)
Instances For
Adds an Hour.Offset to a PlainDateTime, adjusting the date if the hour overflows.
Equations
- dt.addHours hours = dt.addNanoseconds hours.toNanoseconds
Instances For
Subtracts an Hour.Offset from a PlainDateTime, adjusting the date if the hour underflows.
Instances For
Adds a Minute.Offset to a PlainDateTime, adjusting the hour and date if the minutes overflow.
Equations
- dt.addMinutes minutes = dt.addNanoseconds minutes.toNanoseconds
Instances For
Subtracts a Minute.Offset from a PlainDateTime, adjusting the hour and date if the minutes underflow.
Equations
- dt.subMinutes minutes = dt.addMinutes (-minutes)
Instances For
Adds a Second.Offset to a PlainDateTime, adjusting the minute, hour, and date if the seconds overflow.
Equations
- dt.addSeconds seconds = dt.addNanoseconds seconds.toNanoseconds
Instances For
Subtracts a Second.Offset from a PlainDateTime, adjusting the minute, hour, and date if the seconds underflow.
Equations
- dt.subSeconds seconds = dt.addSeconds (-seconds)
Instances For
Adds a Millisecond.Offset to a PlainDateTime, adjusting the second, minute, hour, and date if the milliseconds overflow.
Equations
- dt.addMilliseconds milliseconds = dt.addNanoseconds milliseconds.toNanoseconds
Instances For
Subtracts a Millisecond.Offset from a PlainDateTime, adjusting the second, minute, hour, and date if the milliseconds underflow.
Equations
- dt.subMilliseconds milliseconds = dt.addMilliseconds (-milliseconds)
Instances For
Getter for the Millisecond inside of a PlainDateTime.
Equations
- dt.millisecond = dt.time.millisecond
Instances For
Getter for the Nanosecond.Ordinal inside of a PlainDateTime.
Equations
- dt.nanosecond = dt.time.nanosecond
Instances For
Checks if the PlainDateTime is in a leap year.
Equations
- date.inLeapYear = date.year.isLeap
Instances For
Determines the week of the year for the given PlainDateTime, using firstDay as the start of the week.
Equations
- date.weekOfYear firstDay = date.date.weekOfYear firstDay
Instances For
Returns the week-based year for the given PlainDateTime, using firstDay as the start of the week.
The week-based year may differ from the calendar year for dates near the start or end of the year.
Instances For
Returns the unaligned week of the month for a PlainDateTime (day divided by 7, plus 1).
Equations
- date.weekOfMonth = date.date.weekOfMonth
Instances For
Determines the week of the month for the given PlainDateTime, using firstDay as the start of the week.
Equations
- date.alignedWeekOfMonth firstDay = date.date.alignedWeekOfMonth firstDay
Instances For
Combines a PlainTime and PlainDate into a PlainDateTime.
Equations
- Std.Time.PlainDateTime.atDate time date = { date := date, time := time }
Instances For
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
- Std.Time.PlainDateTime.instHAddDuration = { hAdd := fun (x : Std.Time.PlainDateTime) (y : Std.Time.Duration) => x.addNanoseconds y.toNanoseconds }