Represents a date and time with timezone information.
- date : Thunk Std.Time.PlainDateTime
The plain datetime component, evaluated lazily.
- timestamp : Std.Time.Timestamp
The corresponding timestamp for the datetime.
- rules : Std.Time.TimeZone.ZoneRules
The timezone rules applied to this datetime.
- timezone : Std.Time.TimeZone
The timezone associated with this datetime.
Instances For
Equations
- Std.Time.instInhabitedZonedDateTime = { default := { date := { fn := default }, timestamp := default, rules := default, timezone := default } }
Creates a new ZonedDateTime
out of a Timestamp
and a ZoneRules
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Creates a new ZonedDateTime
out of a PlainDateTime
and a ZoneRules
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Creates a new ZonedDateTime
out of a Timestamp
and a TimeZone
.
Equations
Instances For
Creates a new ZonedDateTime
out of a PlainDateTime
and a TimeZone
.
Equations
Instances For
Creates a new Timestamp
out of a ZonedDateTime
.
Equations
- date.toTimestamp = date.timestamp
Instances For
Changes the ZoleRules
to a new one.
Equations
- date.convertZoneRules tz₁ = Std.Time.ZonedDateTime.ofTimestamp date.toTimestamp tz₁
Instances For
Creates a new ZonedDateTime
out of a PlainDateTime
. It assumes that the PlainDateTime
is relative
to UTC.
Equations
- Std.Time.ZonedDateTime.ofPlainDateTimeAssumingUTC date tz = Std.Time.ZonedDateTime.ofTimestamp date.toTimestampAssumingUTC tz
Instances For
Converts a ZonedDateTime
to a PlainDateTime
Equations
- dt.toPlainDateTime = dt.date.get
Instances For
Converts a ZonedDateTime
to a PlainDateTime
Equations
- dt.toDateTime = Std.Time.DateTime.ofTimestamp dt.timestamp dt.timezone
Instances For
Getter for the PlainTime
inside of a ZonedDateTime
Equations
- zdt.time = zdt.date.get.time
Instances For
Getter for the Year
inside of a ZonedDateTime
Equations
- zdt.year = zdt.date.get.year
Instances For
Getter for the Month
inside of a ZonedDateTime
Equations
- zdt.month = zdt.date.get.month
Instances For
Getter for the Day
inside of a ZonedDateTime
Equations
- zdt.day = zdt.date.get.day
Instances For
Getter for the Hour
inside of a ZonedDateTime
Equations
- zdt.hour = zdt.date.get.time.hour
Instances For
Getter for the Minute
inside of a ZonedDateTime
Equations
- zdt.minute = zdt.date.get.minute
Instances For
Getter for the Second
inside of a ZonedDateTime
Equations
- zdt.second = zdt.date.get.time.second.snd
Instances For
Getter for the Millisecond
inside of a ZonedDateTime
.
Equations
- dt.millisecond = dt.date.get.time.millisecond
Instances For
Getter for the Nanosecond
inside of a ZonedDateTime
Equations
- zdt.nanosecond = zdt.date.get.time.nanosecond
Instances For
Getter for the TimeZone.Offset
inside of a ZonedDateTime
Equations
- zdt.offset = zdt.timezone.offset
Instances For
Transforms a tuple of a ZonedDateTime
into a Day.Ordinal.OfYear
.
Equations
- date.dayOfYear = Std.Time.ValidDate.dayOfYear ⟨(date.month, date.day), ⋯⟩
Instances For
Determines the week of the year for the given ZonedDateTime
.
Equations
- date.weekOfYear = date.date.get.weekOfYear
Instances For
Returns the unaligned week of the month for a ZonedDateTime
(day divided by 7, plus 1).
Equations
- date.weekOfMonth = date.date.get.weekOfMonth
Instances For
Determines the week of the month for the given ZonedDateTime
. The week of the month is calculated based
on the day of the month and the weekday. Each week starts on Monday because the entire library is
based on the Gregorian Calendar.
Equations
- date.alignedWeekOfMonth = date.date.get.alignedWeekOfMonth
Instances For
Determines the quarter of the year for the given ZonedDateTime
.
Equations
- date.quarter = date.date.get.quarter
Instances For
Add Day.Offset
to a ZonedDateTime
.
Equations
- dt.addDays days = Std.Time.ZonedDateTime.ofTimestamp (dt.timestamp.toPlainDateTimeAssumingUTC.addDays days).toTimestampAssumingUTC dt.rules
Instances For
Subtract Day.Offset
from a ZonedDateTime
.
Equations
- dt.subDays days = Std.Time.ZonedDateTime.ofTimestamp (dt.timestamp.toPlainDateTimeAssumingUTC.subDays days).toTimestampAssumingUTC dt.rules
Instances For
Add Week.Offset
to a ZonedDateTime
.
Equations
- dt.addWeeks weeks = Std.Time.ZonedDateTime.ofTimestamp (dt.timestamp.toPlainDateTimeAssumingUTC.addWeeks weeks).toTimestampAssumingUTC dt.rules
Instances For
Subtract Week.Offset
from a ZonedDateTime
.
Equations
- dt.subWeeks weeks = Std.Time.ZonedDateTime.ofTimestamp (dt.timestamp.toPlainDateTimeAssumingUTC.subWeeks weeks).toTimestampAssumingUTC dt.rules
Instances For
Add Month.Offset
to a ZonedDateTime
, clipping to the last valid day.
Equations
- dt.addMonthsClip months = Std.Time.ZonedDateTime.ofTimestamp (dt.timestamp.toPlainDateTimeAssumingUTC.addMonthsClip months).toTimestampAssumingUTC dt.rules
Instances For
Subtract Month.Offset
from a ZonedDateTime
, clipping to the last valid day.
Equations
- dt.subMonthsClip months = Std.Time.ZonedDateTime.ofTimestamp (dt.timestamp.toPlainDateTimeAssumingUTC.subMonthsClip months).toTimestampAssumingUTC dt.rules
Instances For
Add Month.Offset
to a ZonedDateTime
, rolling over excess days.
Equations
- dt.addMonthsRollOver months = Std.Time.ZonedDateTime.ofTimestamp (dt.timestamp.toPlainDateTimeAssumingUTC.addMonthsRollOver months).toTimestampAssumingUTC dt.rules
Instances For
Subtract Month.Offset
from a ZonedDateTime
, rolling over excess days.
Equations
- dt.subMonthsRollOver months = Std.Time.ZonedDateTime.ofTimestamp (dt.timestamp.toPlainDateTimeAssumingUTC.subMonthsRollOver months).toTimestampAssumingUTC dt.rules
Instances For
Add Year.Offset
to a ZonedDateTime
, rolling over excess days.
Equations
- dt.addYearsRollOver years = Std.Time.ZonedDateTime.ofTimestamp (dt.timestamp.toPlainDateTimeAssumingUTC.addYearsRollOver years).toTimestampAssumingUTC dt.rules
Instances For
Add Year.Offset
to a ZonedDateTime
, clipping to the last valid day.
Equations
- dt.addYearsClip years = Std.Time.ZonedDateTime.ofTimestamp (dt.timestamp.toPlainDateTimeAssumingUTC.addYearsClip years).toTimestampAssumingUTC dt.rules
Instances For
Subtract Year.Offset
from a ZonedDateTime
, clipping to the last valid day.
Equations
- dt.subYearsClip years = Std.Time.ZonedDateTime.ofTimestamp (dt.timestamp.toPlainDateTimeAssumingUTC.subYearsClip years).toTimestampAssumingUTC dt.rules
Instances For
Subtract Year.Offset
from a ZonedDateTime
, rolling over excess days.
Equations
- dt.subYearsRollOver years = Std.Time.ZonedDateTime.ofTimestamp (dt.timestamp.toPlainDateTimeAssumingUTC.subYearsRollOver years).toTimestampAssumingUTC dt.rules
Instances For
Add Hour.Offset
to a ZonedDateTime
.
Equations
- dt.addHours hours = Std.Time.ZonedDateTime.ofTimestamp (dt.timestamp.toPlainDateTimeAssumingUTC.addHours hours).toTimestampAssumingUTC dt.rules
Instances For
Subtract Hour.Offset
from a ZonedDateTime
.
Equations
- dt.subHours hours = Std.Time.ZonedDateTime.ofTimestamp (dt.timestamp.toPlainDateTimeAssumingUTC.subHours hours).toTimestampAssumingUTC dt.rules
Instances For
Add Minute.Offset
to a ZonedDateTime
.
Equations
- dt.addMinutes minutes = Std.Time.ZonedDateTime.ofTimestamp (dt.timestamp.toPlainDateTimeAssumingUTC.addMinutes minutes).toTimestampAssumingUTC dt.rules
Instances For
Subtract Minute.Offset
from a ZonedDateTime
.
Equations
- dt.subMinutes minutes = Std.Time.ZonedDateTime.ofTimestamp (dt.timestamp.toPlainDateTimeAssumingUTC.subMinutes minutes).toTimestampAssumingUTC dt.rules
Instances For
Add Millisecond.Offset
to a DateTime
.
Equations
- dt.addMilliseconds milliseconds = Std.Time.ZonedDateTime.ofTimestamp (dt.timestamp.toPlainDateTimeAssumingUTC.addMilliseconds milliseconds).toTimestampAssumingUTC dt.rules
Instances For
Subtract Millisecond.Offset
from a DateTime
.
Equations
- dt.subMilliseconds milliseconds = Std.Time.ZonedDateTime.ofTimestamp (dt.timestamp.toPlainDateTimeAssumingUTC.subMilliseconds milliseconds).toTimestampAssumingUTC dt.rules
Instances For
Add Second.Offset
to a ZonedDateTime
.
Equations
- dt.addSeconds seconds = Std.Time.ZonedDateTime.ofTimestamp (dt.timestamp.toPlainDateTimeAssumingUTC.addSeconds seconds).toTimestampAssumingUTC dt.rules
Instances For
Subtract Second.Offset
from a ZonedDateTime
.
Equations
- dt.subSeconds seconds = Std.Time.ZonedDateTime.ofTimestamp (dt.timestamp.toPlainDateTimeAssumingUTC.subSeconds seconds).toTimestampAssumingUTC dt.rules
Instances For
Add Nanosecond.Offset
to a ZonedDateTime
.
Equations
- dt.addNanoseconds nanoseconds = Std.Time.ZonedDateTime.ofTimestamp (dt.timestamp.toPlainDateTimeAssumingUTC.addNanoseconds nanoseconds).toTimestampAssumingUTC dt.rules
Instances For
Subtract Nanosecond.Offset
from a ZonedDateTime
.
Equations
- dt.subNanoseconds nanoseconds = Std.Time.ZonedDateTime.ofTimestamp (dt.timestamp.toPlainDateTimeAssumingUTC.subNanoseconds nanoseconds).toTimestampAssumingUTC dt.rules
Instances For
Determines the era of the given ZonedDateTime
based on its year.
Equations
- date.era = date.date.get.era
Instances For
Sets the ZonedDateTime
to the specified desiredWeekday
.
Equations
- dt.withWeekday desiredWeekday = Std.Time.ZonedDateTime.ofPlainDateTime (dt.date.get.withWeekday desiredWeekday) dt.rules
Instances For
Creates a new ZonedDateTime
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 = Std.Time.ZonedDateTime.ofPlainDateTime (dt.date.get.withDaysClip days) dt.rules
Instances For
Creates a new ZonedDateTime
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 = Std.Time.ZonedDateTime.ofPlainDateTime (dt.date.get.withDaysRollOver days) dt.rules
Instances For
Creates a new ZonedDateTime
by adjusting the month to the given month
value.
The day remains unchanged, and any invalid days for the new month will be handled according to the clip
behavior.
Equations
- dt.withMonthClip month = Std.Time.ZonedDateTime.ofPlainDateTime (dt.date.get.withMonthClip month) dt.rules
Instances For
Creates a new ZonedDateTime
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 = Std.Time.ZonedDateTime.ofPlainDateTime (dt.date.get.withMonthRollOver month) dt.rules
Instances For
Creates a new ZonedDateTime
by adjusting the year to the given year
value. The month and day remain unchanged,
and any invalid days for the new year will be handled according to the clip
behavior.
Equations
- dt.withYearClip year = Std.Time.ZonedDateTime.ofPlainDateTime (dt.date.get.withYearClip year) dt.rules
Instances For
Creates a new ZonedDateTime
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 = Std.Time.ZonedDateTime.ofPlainDateTime (dt.date.get.withYearRollOver year) dt.rules
Instances For
Creates a new ZonedDateTime
by adjusting the hour
component.
Equations
- dt.withHours hour = Std.Time.ZonedDateTime.ofPlainDateTime (dt.date.get.withHours hour) dt.rules
Instances For
Creates a new ZonedDateTime
by adjusting the minute
component.
Equations
- dt.withMinutes minute = Std.Time.ZonedDateTime.ofPlainDateTime (dt.date.get.withMinutes minute) dt.rules
Instances For
Creates a new ZonedDateTime
by adjusting the second
component.
Equations
- dt.withSeconds second = Std.Time.ZonedDateTime.ofPlainDateTime (dt.date.get.withSeconds second) dt.rules
Instances For
Creates a new ZonedDateTime
by adjusting the nano
component with a new millis
that will set
in the millisecond scale.
Equations
- dt.withMilliseconds millis = Std.Time.ZonedDateTime.ofPlainDateTime (dt.date.get.withMilliseconds millis) dt.rules
Instances For
Creates a new ZonedDateTime
by adjusting the nano
component.
Equations
- dt.withNanoseconds nano = Std.Time.ZonedDateTime.ofPlainDateTime (dt.date.get.withNanoseconds nano) dt.rules
Instances For
Checks if the ZonedDateTime
is in a leap year.
Equations
- date.inLeapYear = date.year.isLeap
Instances For
Converts a ZonedDateTime
to the number of days since the UNIX epoch.
Equations
- date.toDaysSinceUNIXEpoch = date.date.get.toDaysSinceUNIXEpoch
Instances For
Converts a ZonedDateTime
to the number of days since the UNIX epoch.
Equations
Instances For
Equations
- Std.Time.ZonedDateTime.instHSubDuration = { hSub := fun (x y : Std.Time.ZonedDateTime) => x.toTimestamp - y.toTimestamp }
Equations
- Std.Time.ZonedDateTime.instHAddDuration = { hAdd := fun (x : Std.Time.ZonedDateTime) (y : Std.Time.Duration) => x.addNanoseconds y.toNanoseconds }
Equations
- Std.Time.ZonedDateTime.instHSubDuration_1 = { hSub := fun (x : Std.Time.ZonedDateTime) (y : Std.Time.Duration) => x.subNanoseconds y.toNanoseconds }