~/bend-docscommunity

time.bend relies on unsafe/foreign

raw source on the hub · import bend-kit-time@0.1.2.1/time.bend as Time

Clocks, Duration and Instant, Gregorian dates, RFC 3339 and HTTP-date text, and TZif time zones. Source: https://github.com/paymog/bend-kit/tree/main/time

4 imports
import Base
import bend-kit-int@0.2.0.0/int.bend as Int
import bend-kit-fmt@0.1.0.0/fmt.bend as Fmt
import 0x49814d83de8f70993a43e1002be29ecd/bytes.bend as Bytes

Types

type Duration source · line 9 · raw

Data

secs + nanos / 10^9 seconds, with nanos below 10^9: -0.5 s is Duration{-1, 500000000}.

type Instant source · line 13 · raw

Data

A Duration since 1970-01-01T00:00:00Z. Days are 86400 s: there are no leap seconds.

type Date source · line 17 · raw

Data

A proleptic Gregorian date. The conversions and formats cover years 0 to 9999.

type DateTime source · line 20 · raw

Data

type P source · line 354 · raw

Data

A parser state: the numbers read so far, newest first, and the text left.

type Ttype source · line 572 · raw

Data

A local time type: seconds east of UTC, whether it is daylight time, and its abbreviation.

type Trans source · line 576 · raw

Data

From at on, local time follows types[idx].

type Zone source · line 580 · raw

Data

A TZif zone (RFC 8536): transitions in time order, local time types, and the footer TZ string ("" in version 1).

type TzField source · line 680 · raw

Data

POSIX TZ offsets are seconds west of UTC; transition times are seconds from local midnight.

type TzText source · line 683 · raw

Data

type TzClock source · line 686 · raw

Data

type TzDay source · line 689 · raw

Data

type TzDate source · line 694 · raw

Data

type TzDayPart source · line 697 · raw

Data

type TzDatePart source · line 700 · raw

Data

type TzRule source · line 703 · raw

Data

type TzEvent source · line 1047 · raw

Data

Apply the two transitions for the UTC year and its neighbors. A /time may cross a year boundary.

Definitions

def i64 source · line 23 · raw

@x:U32 -> 0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64

def i64s source · line 27 · raw

@x:U32 -> 0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64

The signed 32-bit value of x, widened.

def i64.of source · line 33 · raw

@hi:U32 -> @lo:U32 -> 0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64

hi * 2^32 + lo, as the bits of an I64.

def Duration.zero source · line 39 · raw

Duration

def Duration.of_secs source · line 42 · raw

@s:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> Duration

def Duration.of_ms source · line 45 · raw

@+ms:U32 -> Duration

def Duration.to_ms source · line 49 · raw

@d:Duration -> 0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64

Whole milliseconds, rounded down.

def Duration.carry source · line 54 · raw

@c:Bool -> @s:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @+n:U32 -> Duration

def Duration.add source · line 61 · raw

@a:Duration -> @b:Duration -> Duration

def Duration.borrow source · line 68 · raw

@c:Bool -> @s:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @+n:U32 -> Duration

n is na - nb, wrapped when na < nb.

def Duration.sub source · line 75 · raw

@a:Duration -> @b:Duration -> Duration

def Duration.neg source · line 80 · raw

@d:Duration -> Duration

def Duration.cmp.then source · line 83 · raw

@c:Cmp -> @+na:U32 -> @+nb:U32 -> Cmp

def Duration.cmp source · line 92 · raw

@a:Duration -> @b:Duration -> Cmp

def Instant.epoch source · line 100 · raw

Instant

def Instant.of_unix source · line 103 · raw

@s:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> Instant

def Instant.of source · line 106 · raw

@d:Duration -> Instant

def Instant.since_epoch source · line 111 · raw

@i:Instant -> Duration

def Instant.add source · line 116 · raw

@i:Instant -> @d:Duration -> Instant

def Instant.since source · line 120 · raw

@a:Instant -> @b:Instant -> Duration

a - b.

def Instant.cmp source · line 123 · raw

@a:Instant -> @b:Instant -> Cmp

def raw.dur source · line 139 · raw

@r:Pair(U32, Pair(U32, U32)) -> Duration

def mono source · line 144 · raw

IO(Duration)

Time since an unspecified start that never goes back. Use it to measure spans.

def now source · line 150 · raw

IO(Instant)

The wall clock. It can jump when the system time is set.

def Date.is_leap source · line 158 · raw

@+y:U32 -> Bool

def Date.days_in_month source · line 163 · raw

@+y:U32 -> @+m:U32 -> U32

0 for a month outside 1 to 12.

def Date.valid source · line 168 · raw

@d:Date -> Bool

def Z.EPOCH source · line 176 · raw

U32

z counts days from -0400-03-01, so every date from year 0 has z > 0 in a U32. The civil-days algorithm is Howard Hinnant's, with the year starting in March.

def Date.to_z.at source · line 179 · raw

@+y:U32 -> @+mp:U32 -> @+d:U32 -> U32

def Date.to_z.go source · line 185 · raw

@jf:Bool -> @+y:U32 -> @+m:U32 -> @+d:U32 -> U32

def Date.to_z source · line 192 · raw

@d:Date -> U32

def Date.of_z.fin source · line 197 · raw

@lo:Bool -> @+y:U32 -> @+mp:U32 -> @+d:U32 -> Date

def Date.of_z source · line 204 · raw

@+z:U32 -> Date

def Date.to_days source · line 214 · raw

@d:Date -> 0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64

Days since 1970-01-01.

def Date.of_z.if source · line 217 · raw

@ok:Bool -> @+z:U32 -> Maybe<&2, Date>

def Date.of_days source · line 225 · raw

@days:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> Maybe<&2, Date>

The date days after 1970-01-01, or None outside 0000-01-01 to 9999-12-31.

def Date.weekday source · line 231 · raw

@d:Date -> U32

1 for Monday to 7 for Sunday, as in ISO 8601.

def DateTime.valid source · line 237 · raw

@t:DateTime -> Bool

def DateTime.to_instant source · line 244 · raw

@t:DateTime -> Instant

The instant of a UTC date and time. It does not check t; see DateTime.valid.

def DateTime.at source · line 250 · raw

@m:Maybe<&2, Date> -> @+sod:U32 -> @n:U32 -> Maybe<&2, DateTime>

def DateTime.floor source · line 258 · raw

@neg:Bool -> @q:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @r:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @n:U32 -> Maybe<&2, DateTime>

r is secs % 86400, which has the sign of secs.

def DateTime.of_instant source · line 266 · raw

@i:Instant -> Maybe<&2, DateTime>

The UTC date and time of i, or None outside years 0 to 9999.

def pad source · line 275 · raw

@+x:U32 -> @w:Nat -> String

def Duration.show_ms.pos source · line 279 · raw

@d:Duration -> String

Milliseconds with six decimal places.

def Duration.show_ms.sign source · line 284 · raw

@neg:Bool -> @d:Duration -> String

def Duration.show_ms source · line 291 · raw

@d:Duration -> String

def frac.go source · line 297 · raw

@f:Nat -> @z:Bool -> @+n:U32 -> @+w:Nat -> String

The digits of n / 10^(9 - w), with trailing zeros cut. n is not 0.

def frac source · line 309 · raw

@+n:U32 -> String

def DateTime.rfc3339 source · line 312 · raw

@t:DateTime -> String

def rfc3339 source · line 326 · raw

@i:Instant -> Maybe<&2, String>

RFC 3339 in UTC, such as 1985-04-12T23:20:50.52Z. The fraction has no trailing zeros, and is left out when 0.

def WEEKDAYS source · line 329 · raw

List<&2, String>

def MONTHS source · line 332 · raw

List<&2, String>

def name source · line 335 · raw

@xs:List<&2, String> -> @+i:U32 -> String

def DateTime.http_date source · line 338 · raw

@t:DateTime -> String

def http_date source · line 347 · raw

@i:Instant -> Maybe<&2, String>

IMF-fixdate (RFC 9110 §5.6.7), such as Sun, 06 Nov 1994 08:49:37 GMT. It drops the fraction of a second.

def is_digit source · line 357 · raw

@+c:U32 -> Bool

def digits.go source · line 360 · raw

@n:Nat -> @s:String -> @+acc:U32 -> @ok:Bool -> Maybe<&1, Pair(U32, String)>

def push source · line 375 · raw

@vs:List<&2, U32> -> @r:Maybe<&1, Pair(U32, String)> -> Maybe<&2, P>

def num source · line 383 · raw

@n:Nat -> @p:P -> Maybe<&2, P>

Exactly n digits.

def lit.if source · line 388 · raw

@ok:Bool -> @vs:List<&2, U32> -> @t:String -> Maybe<&2, P>

def lit2 source · line 396 · raw

@+a:U32 -> @+b:U32 -> @p:P -> Maybe<&2, P>

One char that is a or b.

def lit source · line 405 · raw

@+c:U32 -> @p:P -> Maybe<&2, P>

def text source · line 408 · raw

@+w:String -> @p:P -> Maybe<&2, P>

def at.head source · line 414 · raw

@+s:String -> Bool

def secfrac.go source · line 422 · raw

@s:String -> @d:Bool -> @+mul:U32 -> @+acc:U32 -> @+k:U32 -> Pair(U32, Pair(U32, String))

Digits after the first nine are read and dropped. d says whether s starts with a digit.

def secfrac.fin source · line 433 · raw

@vs:List<&2, U32> -> @r:Pair(U32, Pair(U32, String)) -> Maybe<&2, P>

def secfrac.if source · line 437 · raw

@dot:Bool -> @vs:List<&2, U32> -> @+s:String -> Maybe<&2, P>

def secfrac source · line 446 · raw

@p:P -> Maybe<&2, P>

An optional '.' and one or more digits, as nanoseconds.

def zone.num source · line 451 · raw

@+neg:U32 -> @vs:List<&2, U32> -> @t:String -> Maybe<&2, P>

def zone.if source · line 457 · raw

@z:Bool -> @plus:Bool -> @minus:Bool -> @vs:List<&2, U32> -> @t:String -> Maybe<&2, P>

def zone source · line 473 · raw

@p:P -> Maybe<&2, P>

Z, or +hh:mm or -hh:mm, as (sign, hh, mm) with sign 1 for west of UTC.

def index.go source · line 482 · raw

@xs:List<&2, String> -> @+w:String -> @+i:U32 -> U32

def word source · line 490 · raw

@+names:List<&2, String> -> @p:P -> Maybe<&2, P>

One of names, as its index.

def mk.if source · line 496 · raw

@ok:Bool -> @t:DateTime -> Maybe<&2, Instant>

def mk source · line 503 · raw

@+t:DateTime -> Maybe<&2, Instant>

def rfc3339.shift source · line 506 · raw

@m:Maybe<&2, Instant> -> @+west:U32 -> @+hh:U32 -> @+mm:U32 -> Maybe<&2, Instant>

def rfc3339.fin source · line 515 · raw

@p:P -> Maybe<&2, Instant>

def rfc3339.parse source · line 524 · raw

@s:String -> Maybe<&2, Instant>

An RFC 3339 date-time (§5.6), such as 1985-04-12T23:20:50.52Z or 1996-12-19T16:39:57-08:00. T and Z may be lowercase. A leap second (:60) is refused, as Instant has none.

def http_date.fin source · line 541 · raw

@p:P -> Maybe<&2, Instant>

def http_date.parse source · line 550 · raw

@s:String -> Maybe<&2, Instant>

An IMF-fixdate (RFC 9110 §5.6.7), such as Sun, 06 Nov 1994 08:49:37 GMT. The day name must be one of the seven, but it is not checked against the date.

def be source · line 584 · raw

@n:Nat -> @s:String -> @+acc:U32 -> U32

n bytes of a byte string, big-endian.

def be32 source · line 595 · raw

@+s:String -> @n:Nat -> U32

def u8 source · line 598 · raw

@+s:String -> @n:Nat -> U32

def tzif.size source · line 601 · raw

@t8:Bool -> Nat

def tzif.time source · line 608 · raw

@t8:Bool -> @+s:String -> 0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64

def tzif.trans source · line 616 · raw

@n:Nat -> @+t8:Bool -> @+ts:String -> @+ks:String -> List<&2, Trans>

ts holds the transition times and ks their type indexes.

def tzif.abbr source · line 625 · raw

@chars:String -> @+i:U32 -> String

The NUL-terminated abbreviation at byte i of chars.

def tzif.types source · line 628 · raw

@n:Nat -> @+s:String -> @+chars:String -> List<&2, Ttype>

def tzif.if source · line 636 · raw

@ok:Bool -> @z:Zone -> Maybe<&2, Zone>

def tzif.count source · line 644 · raw

@+h:String -> @i:Nat -> Nat

Header counts, in RFC 8536 order: isut, isstd, leap, time, type, char.

def tzif.bsize source · line 648 · raw

@+t8:Bool -> @+h:String -> Nat

The data block's size in bytes, for header h.

def tzif.block source · line 654 · raw

@+t8:Bool -> @+h:String -> Maybe<&2, Zone>

h starts at a header; its data block follows it. Version 2+ blocks have 8-byte times and a footer.

def tzif.go source · line 666 · raw

@v2:Bool -> @+s:String -> Maybe<&2, Zone>

def tzif.parse source · line 675 · raw

@b:0x49814d83de8f70993a43e1002be29ecd/bytes.Bytes -> Maybe<&2, Zone>

A TZif file, such as one from /usr/share/zoneinfo. Versions 2 and up use their 64-bit block. ponytail: reads the bytes as a byte String; walk Bytes directly if zone files get big.

def tz.digit source · line 706 · raw

@+c:U32 -> Bool

def tz.alpha source · line 709 · raw

@+c:U32 -> Bool

def tz.quoted source · line 713 · raw

@+c:U32 -> Bool

def tz.number.stop source · line 716 · raw

@seen:Bool -> @acc:U32 -> @s:String -> Maybe<&2, TzField>

def tz.number.step source · line 723 · raw

@digit:Bool -> @c:U32 -> @t:String -> @acc:U32 -> @seen:Bool -> @next:(@_:Unit -> Maybe<&2, TzField>) -> Maybe<&2, TzField>

def tz.number.go source · line 731 · raw

@s:String -> @+acc:U32 -> @+seen:Bool -> Maybe<&2, TzField>

Three digits suffice for POSIX hour, day, and month fields.

def tz.number source · line 739 · raw

@s:String -> Maybe<&2, TzField>

def tz.name.valid source · line 742 · raw

@ok:Bool -> @name:String -> @rest:String -> Maybe<&2, TzText>

def tz.name.done source · line 749 · raw

@rev:String -> @rest:String -> Maybe<&2, TzText>

def tz.name.empty source · line 753 · raw

@quoted:Bool -> @rev:String -> Maybe<&2, TzText>

def tz.name.branch source · line 760 · raw

@continue:Bool -> @rev:String -> @c:U32 -> @rest:String -> @next:(@_:Unit -> Maybe<&2, TzText>) -> Maybe<&2, TzText>

def tz.name.allowed source · line 767 · raw

@ok:Bool -> @next:(@_:Unit -> Maybe<&2, TzText>) -> Maybe<&2, TzText>

def tz.name.quoted source · line 774 · raw

@end:Bool -> @valid:Bool -> @rev:String -> @rest:String -> @next:(@_:Unit -> Maybe<&2, TzText>) -> Maybe<&2, TzText>

def tz.name.char source · line 781 · raw

@quoted:Bool -> @end:Bool -> @alpha:Bool -> @valid:Bool -> @rev:String -> @c:U32 -> @rest:String -> @next:(@_:Unit -> Maybe<&2, TzText>) -> Maybe<&2, TzText>

def tz.name.go source · line 789 · raw

@s:String -> @+rev:String -> @+quoted:Bool -> Maybe<&2, TzText>

def tz.name source · line 797 · raw

@s:String -> Maybe<&2, TzText>

def tz.field.valid source · line 804 · raw

@ok:Bool -> @n:U32 -> @rest:String -> Maybe<&2, TzField>

def tz.clock.tail source · line 811 · raw

@r:TzField -> @limit:U32 -> Maybe<&2, TzField>

def tz.clock.part source · line 816 · raw

@s:String -> Maybe<&2, TzField>

def tz.clock.valid source · line 825 · raw

@ok:Bool -> @+value:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @negative:Bool -> @rest:String -> Maybe<&2, TzClock>

def tz.clock.seconds source · line 832 · raw

@sec:TzField -> @+hours:U32 -> @+minutes:U32 -> @+max:U32 -> @negative:Bool -> Maybe<&2, TzClock>

def tz.clock.minutes source · line 838 · raw

@m:TzField -> @+hours:U32 -> @+max:U32 -> @+negative:Bool -> Maybe<&2, TzClock>

def tz.clock.finish source · line 844 · raw

@h:TzField -> @+max:U32 -> @+negative:Bool -> Maybe<&2, TzClock>

def tz.clock.read source · line 852 · raw

@s:String -> @max:U32 -> @negative:Bool -> Maybe<&2, TzClock>

def tz.clock.sign source · line 856 · raw

@s:String -> @max:U32 -> Maybe<&2, TzClock>

def tz.day.valid source · line 866 · raw

@ok:Bool -> @d:TzDay -> @rest:String -> Maybe<&2, TzDayPart>

def tz.day.j source · line 873 · raw

@r:TzField -> Maybe<&2, TzDayPart>

def tz.day.n source · line 878 · raw

@r:TzField -> Maybe<&2, TzDayPart>

def tz.after source · line 883 · raw

@c:Char -> @s:String -> String

def tz.day.weekday source · line 890 · raw

@c:TzField -> @+month:U32 -> @+week:U32 -> Maybe<&2, TzDayPart>

def tz.day.week source · line 897 · raw

@b:TzField -> @month:U32 -> Maybe<&2, TzDayPart>

def tz.day.month source · line 904 · raw

@a:TzField -> Maybe<&2, TzDayPart>

def tz.day.m source · line 911 · raw

@s:String -> Maybe<&2, TzDayPart>

def tz.day source · line 916 · raw

@s:String -> Maybe<&2, TzDayPart>

def tz.date.clock source · line 929 · raw

@d:TzDay -> @r:TzClock -> Maybe<&2, TzDatePart>

def tz.date.time source · line 934 · raw

@d:TzDay -> @rest:String -> Maybe<&2, TzDatePart>

def tz.date.part source · line 943 · raw

@r:TzDayPart -> Maybe<&2, TzDatePart>

def tz.date source · line 948 · raw

@s:String -> Maybe<&2, TzDatePart>

def tz.rule.end source · line 953 · raw

@ok:Bool -> @standard:Ttype -> @daylight:Ttype -> @start:TzDate -> @end:TzDate -> Maybe<&2, TzRule>

def tz.rule.finish source · line 960 · raw

@b:TzDatePart -> @standard:Ttype -> @daylight:Ttype -> @start:TzDate -> Maybe<&2, TzRule>

def tz.rule.start source · line 965 · raw

@a:TzDatePart -> @+standard:Ttype -> @+daylight:Ttype -> Maybe<&2, TzRule>

def tz.rule.dates source · line 972 · raw

@+standard:Ttype -> @+daylight:Ttype -> @rest:String -> Maybe<&2, TzRule>

def tz.rule.dstclock source · line 977 · raw

@r:TzClock -> @standard:Ttype -> @abbr:String -> Maybe<&2, TzRule>

def tz.rule.offset source · line 982 · raw

@standard:Ttype -> @abbr:String -> @west:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @rest:String -> Maybe<&2, TzRule>

def tz.rule.named source · line 995 · raw

@name:TzText -> @standard:Ttype -> @west:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> Maybe<&2, TzRule>

def tz.rule.dst source · line 1000 · raw

@+standard:Ttype -> @west:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @rest:String -> Maybe<&2, TzRule>

def tz.rule.stdclock source · line 1009 · raw

@offset:TzClock -> @abbr:String -> Maybe<&2, TzRule>

def tz.rule.standard source · line 1014 · raw

@name:TzText -> Maybe<&2, TzRule>

def tz.rule source · line 1021 · raw

@s:String -> Maybe<&2, TzRule>

def tz.day.index source · line 1027 · raw

@d:TzDay -> @+y:U32 -> U32

The day number of a rule in year y, relative to January 1.

def tz.date.utc source · line 1040 · raw

@d:TzDate -> @+y:U32 -> @west:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> 0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64

def tz.event.select source · line 1050 · raw

@newer:Bool -> @old:Maybe<&2, TzEvent> -> @when:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @dst:Bool -> Maybe<&2, TzEvent>

def tz.event.new source · line 1057 · raw

@+now:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @old:Maybe<&2, TzEvent> -> @+when:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @dst:Bool -> Maybe<&2, TzEvent>

def tz.event.year source · line 1065 · raw

@+now:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @old:Maybe<&2, TzEvent> -> @+r:TzRule -> @+y:U32 -> Maybe<&2, TzEvent>

def tz.event.prev source · line 1071 · raw

@+now:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @old:Maybe<&2, TzEvent> -> @+r:TzRule -> @+y:U32 -> Maybe<&2, TzEvent>

def tz.event.next.if source · line 1078 · raw

@valid:Bool -> @now:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @old:Maybe<&2, TzEvent> -> @r:TzRule -> @y:U32 -> Maybe<&2, TzEvent>

def tz.event.next source · line 1084 · raw

@+now:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @old:Maybe<&2, TzEvent> -> @+r:TzRule -> @+y:U32 -> Maybe<&2, TzEvent>

def tz.event.type source · line 1088 · raw

@ev:Maybe<&2, TzEvent> -> @+r:TzRule -> Ttype

def tz.rule.at source · line 1099 · raw

@+r:TzRule -> @+secs:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @+year:U32 -> Ttype

def tz.rule.date source · line 1104 · raw

@d:Maybe<&2, DateTime> -> @r:TzRule -> @secs:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> Maybe<&2, Ttype>

def tz.rule.lookup source · line 1111 · raw

@rule:Maybe<&2, TzRule> -> @+secs:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> Maybe<&2, Ttype>

def Zone.find source · line 1120 · raw

@ts:List<&2, Trans> -> @+secs:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @+cur:U32 -> U32

The type index at secs: the last transition at or before it, or type 0 before the first. ponytail: linear scan; bisect an Array if lookups get hot.

def Zone.last.go source · line 1126 · raw

@ts:List<&2, Trans> -> @+secs:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @+last:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> Bool

def Zone.last source · line 1132 · raw

@ts:List<&2, Trans> -> @secs:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> Bool

def Zone.at.fallback source · line 1140 · raw

@m:Maybe<&2, Ttype> -> @types:List<&2, Ttype> -> @ts:List<&2, Trans> -> @secs:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> Maybe<&2, Ttype>

def Zone.at.footer source · line 1146 · raw

@use:Bool -> @tz:String -> @types:List<&2, Ttype> -> @ts:List<&2, Trans> -> @+secs:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> Maybe<&2, Ttype>

def Zone.at.tz source · line 1153 · raw

@empty:Bool -> @tz:String -> @types:List<&2, Ttype> -> @+ts:List<&2, Trans> -> @+secs:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> Maybe<&2, Ttype>

def Zone.at source · line 1163 · raw

@z:Zone -> @i:Instant -> Maybe<&2, Ttype>

The local time type at i. The footer applies strictly after the final explicit transition.

def Zone.local.at source · line 1168 · raw

@m:Maybe<&2, Ttype> -> @i:Instant -> Maybe<&2, DateTime>

def Zone.local source · line 1176 · raw

@z:Zone -> @+i:Instant -> Maybe<&2, DateTime>

The local date and time at i in zone z.

Templates

template fmt.map source · line 318 · raw

@-f:(@_:DateTime -> String) -> @m:Maybe<&2, DateTime> -> Maybe<&2, String>

Effects (foreign code)

effect mono.raw source · line 130 · raw

IO(Pair(U32, Pair(U32, U32)))

(secs hi, secs lo, nanos) of CLOCK_MONOTONIC, from an unspecified start.

foreign: effs/time.c, effs/time.js

effect wall.raw source · line 135 · raw

IO(Pair(U32, Pair(U32, U32)))

(secs hi, secs lo, nanos) of CLOCK_REALTIME, since the Unix epoch.

foreign: effs/time.c, effs/time.js