Get the current time, in the local timezone.
To obtain the current time in a specific timezone, use DateTime.now
or ZonedDateTime.nowAt
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Get the current date, in the local timezone.
Instances For
Get the current time, in the local timezone.
Instances For
Converts a PlainDate
with a TimeZone
to a DateTime
Equations
Instances For
Converts a DateTime
to a PlainDate
Equations
Instances For
Gets the current ZonedDateTime
.
Equations
- Std.Time.DateTime.now = do let tm ← Std.Time.Timestamp.now pure (Std.Time.DateTime.ofTimestamp tm tz)
Instances For
Gets the current ZonedDateTime
.
Equations
- Std.Time.ZonedDateTime.now = do let tm ← Std.Time.Timestamp.now let rules ← Std.Time.Database.defaultGetLocalZoneRules pure (Std.Time.ZonedDateTime.ofTimestamp tm rules)
Instances For
Gets the current ZonedDateTime
using the identifier of a time zone.
Equations
- Std.Time.ZonedDateTime.nowAt id = do let tm ← Std.Time.Timestamp.now let rules ← Std.Time.Database.defaultGetZoneRules id pure (Std.Time.ZonedDateTime.ofTimestamp tm rules)
Instances For
Converts a PlainDate
to a ZonedDateTime
.
Equations
Instances For
Converts a PlainDate
to a ZonedDateTime
using TimeZone
.
Equations
Instances For
Converts a ZonedDateTime
to a PlainDate
Equations
- dt.toPlainDate = dt.toPlainDateTime.date
Instances For
Converts a ZonedDateTime
to a PlainTime
Equations
- dt.toPlainTime = dt.toPlainDateTime.time
Instances For
Creates a new ZonedDateTime
out of a PlainDateTime
and a time zone identifier.
Equations
- Std.Time.ZonedDateTime.of pdt id = do let zr ← Std.Time.Database.defaultGetZoneRules id pure (Std.Time.ZonedDateTime.ofPlainDateTime pdt zr)
Instances For
Converts a PlainDateTime
to a Timestamp
using the ZoneRules
.
Equations
- pdt.toTimestamp zr = (Std.Time.ZonedDateTime.ofPlainDateTime pdt zr).toTimestamp
Instances For
Converts a PlainDateTime
to a Timestamp
using the TimeZone
.
Equations
Instances For
Converts a PlainDate
to a Timestamp
using the ZoneRules
.
Equations
- dt.toTimestamp zr = (Std.Time.ZonedDateTime.ofPlainDate dt zr).toTimestamp
Instances For
Converts a PlainDate
to a Timestamp
using the TimeZone
.