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.
Get the current date, in the local timezone.
Get the current time, in the local timezone.
Converts a PlainDate
with a TimeZone
to a DateTime
Equations
Converts a DateTime
to a PlainDate
Equations
Gets the current ZonedDateTime
.
Equations
- Std.Time.DateTime.now = do let tm ← Std.Time.Timestamp.now pure (Std.Time.DateTime.ofTimestamp tm tz)
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)
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)
Converts a PlainDate
to a ZonedDateTime
.
Equations
Converts a PlainDate
to a ZonedDateTime
using TimeZone
.
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)
Converts a PlainDateTime
to a Timestamp
using the ZoneRules
.
Equations
- pdt.toTimestamp zr = (Std.Time.ZonedDateTime.ofPlainDateTime pdt zr).toTimestamp
Converts a PlainDateTime
to a Timestamp
using the TimeZone
.
Equations
Converts a PlainDate
to a Timestamp
using the ZoneRules
.
Equations
- dt.toTimestamp zr = (Std.Time.ZonedDateTime.ofPlainDate dt zr).toTimestamp
Converts a PlainDate
to a Timestamp
using the TimeZone
.