time.bend relies on unsafe/foreign
raw source on the hub · import bend-kit-time@0.3.0.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 bend-kit-bytes@0.3.3.1/bytes.bend as Bytes
Types
type Duration source · line 8 · raw
Data
secs + nanos / 10^9 seconds, with nanos below 10^9: -0.5 s is Duration{-1, 500000000}.
Duration@secs:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @nanos:U32 -> Duration
type Instant source · line 12 · raw
Data
A Duration since 1970-01-01T00:00:00Z. Days are 86400 s: there are no leap seconds.
Instant@secs:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @nanos:U32 -> Instant
type Date source · line 16 · raw
Data
A proleptic Gregorian date. The conversions and formats cover years 0 to 9999.
Date@year:U32 -> @month:U32 -> @day:U32 -> Date
type DateTime source · line 19 · raw
Data
DateTime@date:Date -> @hour:U32 -> @min:U32 -> @sec:U32 -> @nanos:U32 -> DateTime
type P source · line 384 · raw
Data
A parser state: the numbers read so far, newest first, and the text left.
P@vals:List<&2, U32> -> @rest:String -> P
type Ttype source · line 602 · raw
Data
A local time type: seconds east of UTC, whether it is daylight time, and its abbreviation.
Ttype@utoff:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @dst:Bool -> @abbr:String -> Ttype
type Trans source · line 606 · raw
Data
From at on, local time follows types[idx].
Trans@at:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @idx:U32 -> Trans
type Zone source · line 610 · raw
Data
A TZif zone (RFC 8536): transitions in time order, local time types, and the footer TZ string ("" in version 1).
Zone@trans:List<&2, Trans> -> @types:List<&2, Ttype> -> @tz:String -> Zone
type TzField source · line 710 · raw
Data
POSIX TZ offsets are seconds west of UTC; transition times are seconds from local midnight.
TzField@value:U32 -> @rest:String -> TzField
type TzText source · line 713 · raw
Data
TzText@value:String -> @rest:String -> TzText
type TzClock source · line 716 · raw
Data
TzClock@value:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @rest:String -> TzClock
type TzDay source · line 719 · raw
Data
Julian@day:U32 -> TzDay
Ordinal@day:U32 -> TzDay
MonthWeek@month:U32 -> @week:U32 -> @weekday:U32 -> TzDay
type TzDate source · line 724 · raw
Data
TzDate@day:TzDay -> @seconds:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> TzDate
type TzDayPart source · line 727 · raw
Data
TzDayPart@day:TzDay -> @rest:String -> TzDayPart
type TzDatePart source · line 730 · raw
Data
TzDatePart@date:TzDate -> @rest:String -> TzDatePart
type TzRule source · line 733 · raw
Data
TzRule@std:Ttype -> @daylight:Ttype -> @start:TzDate -> @end:TzDate -> TzRule
type TzEvent source · line 1077 · raw
Data
Apply the two transitions for the UTC year and its neighbors. A /time may cross a year boundary.
TzEvent@when:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @dst:Bool -> TzEvent
Definitions
def i64 source · line 22 · raw
@x:U32 -> 0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64
def i64s source · line 26 · raw
@x:U32 -> 0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64
The signed 32-bit value of x, widened.
def i64.of source · line 32 · raw
@hi:U32 -> @lo:U32 -> 0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64
hi * 2^32 + lo, as the bits of an I64.
def Duration.zero source · line 38 · raw
Duration
def Duration.of_secs source · line 41 · raw
@s:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> Duration
def Duration.of_ms source · line 44 · raw
@+ms:U32 -> Duration
def Duration.to_ms source · line 48 · raw
@d:Duration -> 0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64
Whole milliseconds, rounded down.
def Duration.to_nat.of source · line 53 · raw
@m:Maybe<&2, Nat> -> @+per:Nat -> @+n:U32 -> Nat
def Duration.to_ms_nat source · line 61 · raw
@d:Duration -> Nat
Whole milliseconds, rounded down; 0 when d is negative.
def Duration.to_us_nat source · line 67 · raw
@d:Duration -> Nat
Whole microseconds, rounded down; 0 when d is negative.
def Duration.carry source · line 72 · raw
@c:Bool -> @s:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @+n:U32 -> Duration
def Duration.add source · line 79 · raw
@a:Duration -> @b:Duration -> Duration
def Duration.borrow source · line 86 · raw
@c:Bool -> @s:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @+n:U32 -> Duration
n is na - nb, wrapped when na < nb.
def Duration.sub source · line 93 · raw
@a:Duration -> @b:Duration -> Duration
def Duration.neg source · line 98 · raw
@d:Duration -> Duration
def Duration.cmp.then source · line 101 · raw
@c:Cmp -> @+na:U32 -> @+nb:U32 -> Cmp
def Duration.cmp source · line 110 · raw
@a:Duration -> @b:Duration -> Cmp
def Instant.epoch source · line 118 · raw
Instant
def Instant.of_unix source · line 121 · raw
@s:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> Instant
def Instant.of source · line 124 · raw
@d:Duration -> Instant
def Instant.since_epoch source · line 129 · raw
@i:Instant -> Duration
def Instant.add source · line 134 · raw
@i:Instant -> @d:Duration -> Instant
def Instant.since source · line 138 · raw
@a:Instant -> @b:Instant -> Duration
a - b.
def Instant.cmp source · line 141 · raw
@a:Instant -> @b:Instant -> Cmp
def raw.dur source · line 157 · raw
@r:Pair(U32, Pair(U32, U32)) -> Duration
def mono source · line 162 · raw
IO(Duration)
Time since an unspecified start that never goes back. Use it to measure spans.
def mono.ms source · line 168 · raw
IO(Nat)
Monotonic milliseconds. Pure cores that take a Nat now in ms take this.
def mono.us source · line 174 · raw
IO(Nat)
Monotonic microseconds.
def now source · line 180 · raw
IO(Instant)
The wall clock. It can jump when the system time is set.
def Date.is_leap source · line 188 · raw
@+y:U32 -> Bool
def Date.days_in_month source · line 193 · raw
@+y:U32 -> @+m:U32 -> U32
0 for a month outside 1 to 12.
def Date.valid source · line 198 · raw
@d:Date -> Bool
def Z.EPOCH source · line 206 · 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 209 · raw
@+y:U32 -> @+mp:U32 -> @+d:U32 -> U32
def Date.to_z.go source · line 215 · raw
@jf:Bool -> @+y:U32 -> @+m:U32 -> @+d:U32 -> U32
def Date.to_z source · line 222 · raw
@d:Date -> U32
def Date.of_z.fin source · line 227 · raw
@lo:Bool -> @+y:U32 -> @+mp:U32 -> @+d:U32 -> Date
def Date.of_z source · line 234 · raw
@+z:U32 -> Date
def Date.to_days source · line 244 · raw
@d:Date -> 0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64
Days since 1970-01-01.
def Date.of_z.if source · line 247 · raw
@ok:Bool -> @+z:U32 -> Maybe<&2, Date>
def Date.of_days source · line 255 · 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 261 · raw
@d:Date -> U32
1 for Monday to 7 for Sunday, as in ISO 8601.
def DateTime.valid source · line 267 · raw
@t:DateTime -> Bool
def DateTime.to_instant source · line 274 · 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 280 · raw
@m:Maybe<&2, Date> -> @+sod:U32 -> @n:U32 -> Maybe<&2, DateTime>
def DateTime.floor source · line 288 · 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 296 · raw
@i:Instant -> Maybe<&2, DateTime>
The UTC date and time of i, or None outside years 0 to 9999.
def pad source · line 305 · raw
@+x:U32 -> @w:Nat -> String
def Duration.show_ms.pos source · line 309 · raw
@d:Duration -> String
Milliseconds with six decimal places.
def Duration.show_ms.sign source · line 314 · raw
@neg:Bool -> @d:Duration -> String
def Duration.show_ms source · line 321 · raw
@d:Duration -> String
def frac.go source · line 327 · 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 339 · raw
@+n:U32 -> String
def DateTime.rfc3339 source · line 342 · raw
@t:DateTime -> String
def rfc3339 source · line 356 · 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 359 · raw
List<&2, String>
def MONTHS source · line 362 · raw
List<&2, String>
def name source · line 365 · raw
@xs:List<&2, String> -> @+i:U32 -> String
def DateTime.http_date source · line 368 · raw
@t:DateTime -> String
def http_date source · line 377 · 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 387 · raw
@+c:U32 -> Bool
def digits.go source · line 390 · raw
@n:Nat -> @s:String -> @+acc:U32 -> @ok:Bool -> Maybe<&1, Pair(U32, String)>
def push source · line 405 · raw
@vs:List<&2, U32> -> @r:Maybe<&1, Pair(U32, String)> -> Maybe<&2, P>
def num source · line 413 · raw
@n:Nat -> @p:P -> Maybe<&2, P>
Exactly n digits.
def lit.if source · line 418 · raw
@ok:Bool -> @vs:List<&2, U32> -> @t:String -> Maybe<&2, P>
def lit2 source · line 426 · raw
@+a:U32 -> @+b:U32 -> @p:P -> Maybe<&2, P>
One char that is a or b.
def lit source · line 435 · raw
@+c:U32 -> @p:P -> Maybe<&2, P>
def text source · line 438 · raw
@+w:String -> @p:P -> Maybe<&2, P>
def at.head source · line 444 · raw
@+s:String -> Bool
def secfrac.go source · line 452 · 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 463 · raw
@vs:List<&2, U32> -> @r:Pair(U32, Pair(U32, String)) -> Maybe<&2, P>
def secfrac.if source · line 467 · raw
@dot:Bool -> @vs:List<&2, U32> -> @+s:String -> Maybe<&2, P>
def secfrac source · line 476 · raw
@p:P -> Maybe<&2, P>
An optional '.' and one or more digits, as nanoseconds.
def zone.num source · line 481 · raw
@+neg:U32 -> @vs:List<&2, U32> -> @t:String -> Maybe<&2, P>
def zone.if source · line 487 · raw
@z:Bool -> @plus:Bool -> @minus:Bool -> @vs:List<&2, U32> -> @t:String -> Maybe<&2, P>
def zone source · line 503 · 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 512 · raw
@xs:List<&2, String> -> @+w:String -> @+i:U32 -> U32
def word source · line 520 · raw
@+names:List<&2, String> -> @p:P -> Maybe<&2, P>
One of names, as its index.
def mk.if source · line 526 · raw
@ok:Bool -> @t:DateTime -> Maybe<&2, Instant>
def mk source · line 533 · raw
@+t:DateTime -> Maybe<&2, Instant>
def rfc3339.shift source · line 536 · raw
@m:Maybe<&2, Instant> -> @+west:U32 -> @+hh:U32 -> @+mm:U32 -> Maybe<&2, Instant>
def rfc3339.fin source · line 545 · raw
@p:P -> Maybe<&2, Instant>
def rfc3339.parse source · line 554 · 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 571 · raw
@p:P -> Maybe<&2, Instant>
def http_date.parse source · line 580 · 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 614 · raw
@n:Nat -> @s:String -> @+acc:U32 -> U32
n bytes of a byte string, big-endian.
def be32 source · line 625 · raw
@+s:String -> @n:Nat -> U32
def u8 source · line 628 · raw
@+s:String -> @n:Nat -> U32
def tzif.size source · line 631 · raw
@t8:Bool -> Nat
def tzif.time source · line 638 · raw
@t8:Bool -> @+s:String -> 0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64
def tzif.trans source · line 646 · 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 655 · raw
@chars:String -> @+i:U32 -> String
The NUL-terminated abbreviation at byte i of chars.
def tzif.types source · line 658 · raw
@n:Nat -> @+s:String -> @+chars:String -> List<&2, Ttype>
def tzif.if source · line 666 · raw
@ok:Bool -> @z:Zone -> Maybe<&2, Zone>
def tzif.count source · line 674 · raw
@+h:String -> @i:Nat -> Nat
Header counts, in RFC 8536 order: isut, isstd, leap, time, type, char.
def tzif.bsize source · line 678 · raw
@+t8:Bool -> @+h:String -> Nat
The data block's size in bytes, for header h.
def tzif.block source · line 684 · 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 696 · raw
@v2:Bool -> @+s:String -> Maybe<&2, Zone>
def tzif.parse source · line 705 · raw
@b:0xec25e4adfb02e59e4b817801115988ee/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 736 · raw
@+c:U32 -> Bool
def tz.alpha source · line 739 · raw
@+c:U32 -> Bool
def tz.quoted source · line 743 · raw
@+c:U32 -> Bool
def tz.number.stop source · line 746 · raw
@seen:Bool -> @acc:U32 -> @s:String -> Maybe<&2, TzField>
def tz.number.step source · line 753 · 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 761 · 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 769 · raw
@s:String -> Maybe<&2, TzField>
def tz.name.valid source · line 772 · raw
@ok:Bool -> @name:String -> @rest:String -> Maybe<&2, TzText>
def tz.name.done source · line 779 · raw
@rev:String -> @rest:String -> Maybe<&2, TzText>
def tz.name.empty source · line 783 · raw
@quoted:Bool -> @rev:String -> Maybe<&2, TzText>
def tz.name.branch source · line 790 · raw
@continue:Bool -> @rev:String -> @c:U32 -> @rest:String -> @next:(@_:Unit -> Maybe<&2, TzText>) -> Maybe<&2, TzText>
def tz.name.allowed source · line 797 · raw
@ok:Bool -> @next:(@_:Unit -> Maybe<&2, TzText>) -> Maybe<&2, TzText>
def tz.name.quoted source · line 804 · raw
@end:Bool -> @valid:Bool -> @rev:String -> @rest:String -> @next:(@_:Unit -> Maybe<&2, TzText>) -> Maybe<&2, TzText>
def tz.name.char source · line 811 · 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 819 · raw
@s:String -> @+rev:String -> @+quoted:Bool -> Maybe<&2, TzText>
def tz.name source · line 827 · raw
@s:String -> Maybe<&2, TzText>
def tz.field.valid source · line 834 · raw
@ok:Bool -> @n:U32 -> @rest:String -> Maybe<&2, TzField>
def tz.clock.tail source · line 841 · raw
@r:TzField -> @limit:U32 -> Maybe<&2, TzField>
def tz.clock.part source · line 846 · raw
@s:String -> Maybe<&2, TzField>
def tz.clock.valid source · line 855 · raw
@ok:Bool -> @+value:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @negative:Bool -> @rest:String -> Maybe<&2, TzClock>
def tz.clock.seconds source · line 862 · raw
@sec:TzField -> @+hours:U32 -> @+minutes:U32 -> @+max:U32 -> @negative:Bool -> Maybe<&2, TzClock>
def tz.clock.minutes source · line 868 · raw
@m:TzField -> @+hours:U32 -> @+max:U32 -> @+negative:Bool -> Maybe<&2, TzClock>
def tz.clock.finish source · line 874 · raw
@h:TzField -> @+max:U32 -> @+negative:Bool -> Maybe<&2, TzClock>
def tz.clock.read source · line 882 · raw
@s:String -> @max:U32 -> @negative:Bool -> Maybe<&2, TzClock>
def tz.clock.sign source · line 886 · raw
@s:String -> @max:U32 -> Maybe<&2, TzClock>
def tz.day.valid source · line 896 · raw
@ok:Bool -> @d:TzDay -> @rest:String -> Maybe<&2, TzDayPart>
def tz.day.j source · line 903 · raw
@r:TzField -> Maybe<&2, TzDayPart>
def tz.day.n source · line 908 · raw
@r:TzField -> Maybe<&2, TzDayPart>
def tz.after source · line 913 · raw
@c:Char -> @s:String -> String
def tz.day.weekday source · line 920 · raw
@c:TzField -> @+month:U32 -> @+week:U32 -> Maybe<&2, TzDayPart>
def tz.day.week source · line 927 · raw
@b:TzField -> @month:U32 -> Maybe<&2, TzDayPart>
def tz.day.month source · line 934 · raw
@a:TzField -> Maybe<&2, TzDayPart>
def tz.day.m source · line 941 · raw
@s:String -> Maybe<&2, TzDayPart>
def tz.day source · line 946 · raw
@s:String -> Maybe<&2, TzDayPart>
def tz.date.clock source · line 959 · raw
@d:TzDay -> @r:TzClock -> Maybe<&2, TzDatePart>
def tz.date.time source · line 964 · raw
@d:TzDay -> @rest:String -> Maybe<&2, TzDatePart>
def tz.date.part source · line 973 · raw
@r:TzDayPart -> Maybe<&2, TzDatePart>
def tz.date source · line 978 · raw
@s:String -> Maybe<&2, TzDatePart>
def tz.rule.end source · line 983 · raw
@ok:Bool -> @standard:Ttype -> @daylight:Ttype -> @start:TzDate -> @end:TzDate -> Maybe<&2, TzRule>
def tz.rule.finish source · line 990 · raw
@b:TzDatePart -> @standard:Ttype -> @daylight:Ttype -> @start:TzDate -> Maybe<&2, TzRule>
def tz.rule.start source · line 995 · raw
@a:TzDatePart -> @+standard:Ttype -> @+daylight:Ttype -> Maybe<&2, TzRule>
def tz.rule.dates source · line 1002 · raw
@+standard:Ttype -> @+daylight:Ttype -> @rest:String -> Maybe<&2, TzRule>
def tz.rule.dstclock source · line 1007 · raw
@r:TzClock -> @standard:Ttype -> @abbr:String -> Maybe<&2, TzRule>
def tz.rule.offset source · line 1012 · raw
@standard:Ttype -> @abbr:String -> @west:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @rest:String -> Maybe<&2, TzRule>
def tz.rule.named source · line 1025 · raw
@name:TzText -> @standard:Ttype -> @west:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> Maybe<&2, TzRule>
def tz.rule.dst source · line 1030 · raw
@+standard:Ttype -> @west:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @rest:String -> Maybe<&2, TzRule>
def tz.rule.stdclock source · line 1039 · raw
@offset:TzClock -> @abbr:String -> Maybe<&2, TzRule>
def tz.rule.standard source · line 1044 · raw
@name:TzText -> Maybe<&2, TzRule>
def tz.rule source · line 1051 · raw
@s:String -> Maybe<&2, TzRule>
def tz.day.index source · line 1057 · 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 1070 · raw
@d:TzDate -> @+y:U32 -> @west:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> 0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64
def tz.event.select source · line 1080 · raw
@newer:Bool -> @old:Maybe<&2, TzEvent> -> @when:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @dst:Bool -> Maybe<&2, TzEvent>
def tz.event.new source · line 1087 · raw
@+now:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @old:Maybe<&2, TzEvent> -> @+when:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @dst:Bool -> Maybe<&2, TzEvent>
def tz.event.year source · line 1095 · raw
@+now:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @old:Maybe<&2, TzEvent> -> @+r:TzRule -> @+y:U32 -> Maybe<&2, TzEvent>
def tz.event.prev source · line 1101 · raw
@+now:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @old:Maybe<&2, TzEvent> -> @+r:TzRule -> @+y:U32 -> Maybe<&2, TzEvent>
def tz.event.next.if source · line 1108 · raw
@valid:Bool -> @now:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @old:Maybe<&2, TzEvent> -> @r:TzRule -> @y:U32 -> Maybe<&2, TzEvent>
def tz.event.next source · line 1114 · raw
@+now:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @old:Maybe<&2, TzEvent> -> @+r:TzRule -> @+y:U32 -> Maybe<&2, TzEvent>
def tz.event.type source · line 1118 · raw
@ev:Maybe<&2, TzEvent> -> @+r:TzRule -> Ttype
def tz.rule.at source · line 1129 · raw
@+r:TzRule -> @+secs:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @+year:U32 -> Ttype
def tz.rule.date source · line 1134 · raw
@d:Maybe<&2, DateTime> -> @r:TzRule -> @secs:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> Maybe<&2, Ttype>
def tz.rule.lookup source · line 1141 · raw
@rule:Maybe<&2, TzRule> -> @+secs:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> Maybe<&2, Ttype>
def Zone.find source · line 1150 · 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 1156 · raw
@ts:List<&2, Trans> -> @+secs:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> @+last:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> Bool
def Zone.last source · line 1162 · raw
@ts:List<&2, Trans> -> @secs:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> Bool
def Zone.at.fallback source · line 1170 · raw
@m:Maybe<&2, Ttype> -> @types:List<&2, Ttype> -> @ts:List<&2, Trans> -> @secs:0x4eed9d7ac6ece61523d747a9d804e4f0/int.I64 -> Maybe<&2, Ttype>
def Zone.at.tz source · line 1183 · 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 1193 · 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 1198 · raw
@m:Maybe<&2, Ttype> -> @i:Instant -> Maybe<&2, DateTime>
def Zone.local source · line 1206 · raw
@z:Zone -> @+i:Instant -> Maybe<&2, DateTime>
The local date and time at i in zone z.
Templates
template fmt.map source · line 348 · raw
@-f:(@_:DateTime -> String) -> @m:Maybe<&2, DateTime> -> Maybe<&2, String>
Effects (foreign code)
effect mono.raw source · line 148 · 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 153 · 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