module std/time/timestampstd/time/timestamp
import std/num/float64std/num/float64
import std/num/ddoublestd/num/ddouble
import std/num/int32std/num/int32
import std/time/datestd/time/date
pub alias timespanstd/time/timestamp/timespan: V = ddoublestd/num/ddouble/ddouble: V
pub val timespan0std/time/timestamp/timespan0: timespan : timespanstd/time/timestamp/timespan: V = zerostd/num/ddouble/zero: ddouble
pub fun int/timespanstd/time/timestamp/int/timespan: (seconds : int, frac : ? float64) -> timespan( secondsseconds: int : intstd/core/types/int: V, fracfrac: ? float64 : float64std/core/types/float64: V = 0.0literal: float64
hex64= 0x0p+0 )result: -> total timespan : timespanstd/time/timestamp/timespan: V
if fracfrac: float64.is-zerostd/num/float64/is-zero: (d : float64) -> bool then ddoublestd/num/ddouble/int/ddouble: (i : int) -> ddouble(secondsseconds: int) else ddoublestd/num/ddouble/int/ddouble: (i : int) -> ddouble(secondsseconds: int) +std/num/ddouble/(+): (x : ddouble, y : ddouble) -> ddouble ddoublestd/num/ddouble/float64/ddouble: (d : float64) -> ddouble(fracfrac: float64)
pub fun float64/timespanstd/time/timestamp/float64/timespan: (secs : float64) -> timespan( secssecs: float64 : float64std/core/types/float64: V )result: -> total timespan : timespanstd/time/timestamp/timespan: V
ddoublestd/num/ddouble/float64/ddouble: (d : float64) -> ddouble(secssecs: float64)
pub fun tuple64/timespanstd/time/timestamp/tuple64/timespan: (secs : float64, frac : float64) -> timespan( secssecs: float64 : float64std/core/types/float64: V, fracfrac: float64 : float64std/core/types/float64: V )result: -> total timespan : timespanstd/time/timestamp/timespan: V
ddoublestd/num/ddouble/ddouble: (x : float64, y : float64) -> ddouble(secssecs: float64,fracfrac: float64)
pub fun ddouble/timespanstd/time/timestamp/ddouble/timespan: (secs : ddouble) -> timespan( secssecs: ddouble : ddoublestd/num/ddouble/ddouble: V )result: -> total timespan : timespanstd/time/timestamp/timespan: V
secssecs: ddouble
pub fun divstd/time/timestamp/div: (x : timespan, y : timespan, prec : ? int) -> timespan( xx: timespan : timespanstd/time/timestamp/timespan: V, yy: timespan : timespanstd/time/timestamp/timespan: V, precprec: ? int : intstd/core/types/int: V = 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000)result: -> total timespan : timespanstd/time/timestamp/timespan: V
xx: timespan /std/num/ddouble/(/): (x : ddouble, y : ddouble) -> ddouble yy: timespan
pub val isolar-secs-per-daystd/time/timestamp/isolar-secs-per-day: int = 86400literal: int
dec = 86400
hex32= 0x00015180
bit32= 0b00000000000000010101000110000000
pub val solar-secs-per-daystd/time/timestamp/solar-secs-per-day: timespan = isolar-secs-per-daystd/time/timestamp/isolar-secs-per-day: int.timespanstd/time/timestamp/int/timespan: (seconds : int, frac : ? float64) -> timespan
abstract struct timestampstd/time/timestamp/timestamp: V(
sincestd/time/timestamp/timestamp/since: (timestamp : timestamp) -> timespan : timespanstd/time/timestamp/timespan: V, leap32std/time/timestamp/timestamp/leap32: (timestamp : timestamp) -> int32 : int32std/core/types/int32: V
)
pub fun leapstd/time/timestamp/leap: (t : timestamp) -> int( tt: timestamp : timestampstd/time/timestamp/timestamp: V )result: -> total int : intstd/core/types/int: V
tt: timestamp.leap32std/time/timestamp/timestamp/leap32: (timestamp : timestamp) -> int32.intstd/num/int32/int: (i : int32) -> int
pub val timestamp0std/time/timestamp/timestamp0: timestamp : timestampstd/time/timestamp/timestamp: V = Timestampstd/time/timestamp/Timestamp: (since : timespan, leap32 : int32) -> timestamp(ddouble/zerostd/num/ddouble/zero: ddouble,int32/zerostd/num/int32/zero: int32)
pub fun timestampstd/time/timestamp/timestamp: (t : timespan, leap : ? int) -> timestamp( tt: timespan : timespanstd/time/timestamp/timespan: V, leapleap: ? int : intstd/core/types/int: V = 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000 )result: -> total timestamp : timestampstd/time/timestamp/timestamp: V
Timestampstd/time/timestamp/Timestamp: (since : timespan, leap32 : int32) -> timestamp(tt: timespan,leapleap: int.int32std/num/int32/int32: (i : int) -> int32)
pub fun int/timestampstd/time/timestamp/int/timestamp: (t : int, frac : ? float64, leap : ? int) -> timestamp( tt: int : intstd/core/types/int: V, fracfrac: ? float64 : float64std/core/types/float64: V = 0.0literal: float64
hex64= 0x0p+0, leapleap: ? int : intstd/core/types/int: V = 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000 )result: -> total timestamp : timestampstd/time/timestamp/timestamp: V
timestampstd/time/timestamp/timestamp: (t : timespan, leap : ? int) -> timestamp(tt: int.ddoublestd/num/ddouble/int/ddouble: (i : int) -> ddouble +std/num/ddouble/(+): (x : ddouble, y : ddouble) -> ddouble fracfrac: float64.ddoublestd/num/ddouble/float64/ddouble: (d : float64) -> ddouble,leapleap: int)
pub fun timestamp-daysstd/time/timestamp/timestamp-days: (days : int, secs : ? timespan, leap : ? int) -> timestamp( daysdays: int : intstd/core/types/int: V, secssecs: ? timespan : timespanstd/time/timestamp/timespan: V = timespan0std/time/timestamp/timespan0: timespan, leapleap: ? int : intstd/core/types/int: V = 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000 )result: -> total timestamp : timestampstd/time/timestamp/timestamp: V
timestampstd/time/timestamp/timestamp: (t : timespan, leap : ? int) -> timestamp( (daysdays: int *std/core/int/(*): (int, int) -> int isolar-secs-per-daystd/time/timestamp/isolar-secs-per-day: int).timespanstd/time/timestamp/int/timespan: (seconds : int, frac : ? float64) -> timespan +std/num/ddouble/(+): (x : ddouble, y : ddouble) -> ddouble secssecs: timespan, leapleap: int)
pub fun days-secondsstd/time/timestamp/days-seconds: (ts : timestamp) -> (int, ddouble)( tsts: timestamp : timestampstd/time/timestamp/timestamp: V )result: -> total (int, ddouble) : (std/core/types/tuple2: (V, V) -> Vintstd/core/types/int: V,ddoublestd/num/ddouble/ddouble: V)
val secssecs: ddouble = tsts: timestamp.sincestd/time/timestamp/timestamp/since: (timestamp : timestamp) -> timespan.floorstd/num/ddouble/floor: (x : ddouble) -> ddouble
val fracfrac: ddouble = tsts: timestamp.sincestd/time/timestamp/timestamp/since: (timestamp : timestamp) -> timespan -std/num/ddouble/(-): (x : ddouble, y : ddouble) -> ddouble secssecs: ddouble
val (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)daysdays: int,dsecsdsecs: int)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) = divmodstd/core/int/divmod: (x : int, y : int) -> (int, int)(secssecs: ddouble.intstd/num/ddouble/int: (x : ddouble, nonfin : ? int) -> int, isolar-secs-per-daystd/time/timestamp/isolar-secs-per-day: int)
(std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)daysdays: int, dsecsdsecs: int.ddoublestd/num/ddouble/int/ddouble: (i : int) -> ddouble +std/num/ddouble/(+): (x : ddouble, y : ddouble) -> ddouble fracfrac: ddouble)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)
pub fun days-clockstd/time/timestamp/days-clock: (ts : timestamp) -> (int, clock)( tsts: timestamp : timestampstd/time/timestamp/timestamp: V )result: -> total (int, clock) : (std/core/types/tuple2: (V, V) -> Vintstd/core/types/int: V,clockstd/time/date/clock: V)
val (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)daysdays: int,secssecs: ddouble)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) = tsts: timestamp.days-secondsstd/time/timestamp/days-seconds: (ts : timestamp) -> (int, ddouble)
(std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)daysdays: int, clockstd/time/date/leap/clock: (seconds : ddouble, leap : int) -> clock(secssecs: ddouble,tsts: timestamp.leapstd/time/timestamp/leap: (t : timestamp) -> int))std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)
pub fun daysstd/time/timestamp/days: (ts : timestamp) -> int( tsts: timestamp : timestampstd/time/timestamp/timestamp: V )result: -> total int : intstd/core/types/int: V
tsts: timestamp.days-secondsstd/time/timestamp/days-seconds: (ts : timestamp) -> (int, ddouble).fststd/core/types/tuple2/fst: (tuple2 : (int, ddouble)) -> int
pub fun seconds-into-daystd/time/timestamp/seconds-into-day: (ts : timestamp) -> ddouble( tsts: timestamp : timestampstd/time/timestamp/timestamp: V )result: -> total ddouble : ddoublestd/num/ddouble/ddouble: V
tsts: timestamp.days-secondsstd/time/timestamp/days-seconds: (ts : timestamp) -> (int, ddouble).sndstd/core/types/tuple2/snd: (tuple2 : (int, ddouble)) -> ddouble +std/num/ddouble/(+): (x : ddouble, y : ddouble) -> ddouble tsts: timestamp.leapstd/time/timestamp/leap: (t : timestamp) -> int.ddoublestd/num/ddouble/int/ddouble: (i : int) -> ddouble
pub fun unsafe-timespan-withleapstd/time/timestamp/unsafe-timespan-withleap: (ts : timestamp) -> timespan( tsts: timestamp : timestampstd/time/timestamp/timestamp: V )result: -> total timespan : timespanstd/time/timestamp/timespan: V
tsts: timestamp.sincestd/time/timestamp/timestamp/since: (timestamp : timestamp) -> timespan +std/num/ddouble/(+): (x : ddouble, y : ddouble) -> ddouble tsts: timestamp.leapstd/time/timestamp/leap: (t : timestamp) -> int.timespanstd/time/timestamp/int/timespan: (seconds : int, frac : ? float64) -> timespan
pub fun timespan-noleapstd/time/timestamp/timespan-noleap: (ts : timestamp) -> timespan( tsts: timestamp : timestampstd/time/timestamp/timestamp: V )result: -> total timespan : timespanstd/time/timestamp/timespan: V
tsts: timestamp.sincestd/time/timestamp/timestamp/since: (timestamp : timestamp) -> timespan
pub fun round-to-precstd/time/timestamp/round-to-prec: (t : timestamp, prec : int) -> timestamp(tt: timestamp : timestampstd/time/timestamp/timestamp: V, precprec: int : intstd/core/types/int: V )result: -> total timestamp : timestampstd/time/timestamp/timestamp: V
Timestampstd/time/timestamp/Timestamp: (since : timespan, leap32 : int32) -> timestamp(tt: timestamp.sincestd/time/timestamp/timestamp/since: (timestamp : timestamp) -> timespan.round-to-precstd/num/ddouble/round-to-prec: (x : ddouble, prec : int) -> ddouble(precprec: int), tt: timestamp.leap32std/time/timestamp/timestamp/leap32: (timestamp : timestamp) -> int32)
pub fun add-leap-secondsstd/time/timestamp/add-leap-seconds: (ts : timestamp, leaps : timespan) -> timestamp( tsts: timestamp : timestampstd/time/timestamp/timestamp: V, leapsleaps: timespan : timespanstd/time/timestamp/timespan: V )result: -> total timestamp : timestampstd/time/timestamp/timestamp: V
if !std/core/types/bool/(!): (b : bool) -> boolleapsleaps: timespan.is-posstd/num/ddouble/is-pos: (x : ddouble) -> bool then tsts: timestamp elif leapsleaps: timespan <std/num/ddouble/(<): (x : ddouble, y : ddouble) -> bool 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001.timespanstd/time/timestamp/int/timespan: (seconds : int, frac : ? float64) -> timespan &&std/core/types/(&&): (x : bool, y : bool) -> bool tsts: timestamp.leapstd/time/timestamp/leap: (t : timestamp) -> int.is-zerostd/core/int/is-zero: (x : int) -> bool
then Timestampstd/time/timestamp/Timestamp: (since : timespan, leap32 : int32) -> timestamp( (tsts: timestamp.sincestd/time/timestamp/timestamp/since: (timestamp : timestamp) -> timespan -std/num/ddouble/(-): (x : ddouble, y : ddouble) -> ddouble 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001.timespanstd/time/timestamp/int/timespan: (seconds : int, frac : ? float64) -> timespan) +std/num/ddouble/(+): (x : ddouble, y : ddouble) -> ddouble leapsleaps: timespan, 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001.int32std/num/int32/int32: (i : int) -> int32)
else Timestampstd/time/timestamp/Timestamp: (since : timespan, leap32 : int32) -> timestamp( tsts: timestamp.sincestd/time/timestamp/timestamp/since: (timestamp : timestamp) -> timespan +std/num/ddouble/(+): (x : ddouble, y : ddouble) -> ddouble leapsleaps: timespan.fractionstd/num/ddouble/fraction: (x : ddouble) -> ddouble, tsts: timestamp.leap32std/time/timestamp/timestamp/leap32: (timestamp : timestamp) -> int32 +std/num/int32/(+): (x : int32, y : int32) -> int32 leapsleaps: timespan.truncatestd/num/ddouble/truncate: (x : ddouble) -> ddouble.intstd/num/ddouble/int: (x : ddouble, nonfin : ? int) -> int.int32std/num/int32/int32: (i : int) -> int32 )
pub fun add-daysstd/time/timestamp/add-days: (ts : timestamp, days : int) -> timestamp( tsts: timestamp : timestampstd/time/timestamp/timestamp: V, daysdays: int : intstd/core/types/int: V )result: -> total timestamp : timestampstd/time/timestamp/timestamp: V
tsts: timestamp +std/time/timestamp/(+): (ts : timestamp, t : timespan) -> timestamp (daysdays: int *std/core/int/(*): (int, int) -> int isolar-secs-per-daystd/time/timestamp/isolar-secs-per-day: int).timespanstd/time/timestamp/int/timespan: (seconds : int, frac : ? float64) -> timespan
pub fun cmpstd/time/timestamp/cmp: (i : timestamp, j : timestamp) -> order( ii: timestamp : timestampstd/time/timestamp/timestamp: V, jj: timestamp : timestampstd/time/timestamp/timestamp: V )result: -> total order : orderstd/core/types/order: V
match cmpstd/num/ddouble/cmp: (x : ddouble, y : ddouble) -> order(ii: timestamp.sincestd/time/timestamp/timestamp/since: (timestamp : timestamp) -> timespan,jj: timestamp.sincestd/time/timestamp/timestamp/since: (timestamp : timestamp) -> timespan) Eqstd/core/types/Eq: order -> cmpstd/core/int/cmp: (x : int, y : int) -> order(ii: timestamp.leapstd/time/timestamp/leap: (t : timestamp) -> int,jj: timestamp.leapstd/time/timestamp/leap: (t : timestamp) -> int)
ordord: order -> ordord: order
pub fun (<)std/time/timestamp/(<): (i : timestamp, j : timestamp) -> bool( ii: timestamp : timestampstd/time/timestamp/timestamp: V, jj: timestamp : timestampstd/time/timestamp/timestamp: V )result: -> total bool : boolstd/core/types/bool: V { cmpstd/time/timestamp/cmp: (i : timestamp, j : timestamp) -> order(ii: timestamp,jj: timestamp) ==std/core/order/(==): (x : order, y : order) -> bool Ltstd/core/types/Lt: order }
pub fun (<=)std/time/timestamp/(<=): (i : timestamp, j : timestamp) -> bool( ii: timestamp : timestampstd/time/timestamp/timestamp: V, jj: timestamp : timestampstd/time/timestamp/timestamp: V )result: -> total bool : boolstd/core/types/bool: V { cmpstd/time/timestamp/cmp: (i : timestamp, j : timestamp) -> order(ii: timestamp,jj: timestamp) !=std/core/order/(!=): (x : order, y : order) -> bool Gtstd/core/types/Gt: order }
pub fun (>)std/time/timestamp/(>): (i : timestamp, j : timestamp) -> bool( ii: timestamp : timestampstd/time/timestamp/timestamp: V, jj: timestamp : timestampstd/time/timestamp/timestamp: V )result: -> total bool : boolstd/core/types/bool: V { cmpstd/time/timestamp/cmp: (i : timestamp, j : timestamp) -> order(ii: timestamp,jj: timestamp) ==std/core/order/(==): (x : order, y : order) -> bool Gtstd/core/types/Gt: order }
pub fun (>=)std/time/timestamp/(>=): (i : timestamp, j : timestamp) -> bool( ii: timestamp : timestampstd/time/timestamp/timestamp: V, jj: timestamp : timestampstd/time/timestamp/timestamp: V )result: -> total bool : boolstd/core/types/bool: V { cmpstd/time/timestamp/cmp: (i : timestamp, j : timestamp) -> order(ii: timestamp,jj: timestamp) !=std/core/order/(!=): (x : order, y : order) -> bool Ltstd/core/types/Lt: order }
pub fun (==)std/time/timestamp/(==): (i : timestamp, j : timestamp) -> bool( ii: timestamp : timestampstd/time/timestamp/timestamp: V, jj: timestamp : timestampstd/time/timestamp/timestamp: V )result: -> total bool : boolstd/core/types/bool: V { cmpstd/time/timestamp/cmp: (i : timestamp, j : timestamp) -> order(ii: timestamp,jj: timestamp) ==std/core/order/(==): (x : order, y : order) -> bool Eqstd/core/types/Eq: order }
pub fun (!=)std/time/timestamp/(!=): (i : timestamp, j : timestamp) -> bool( ii: timestamp : timestampstd/time/timestamp/timestamp: V, jj: timestamp : timestampstd/time/timestamp/timestamp: V )result: -> total bool : boolstd/core/types/bool: V { cmpstd/time/timestamp/cmp: (i : timestamp, j : timestamp) -> order(ii: timestamp,jj: timestamp) !=std/core/order/(!=): (x : order, y : order) -> bool Eqstd/core/types/Eq: order }
pub fun minstd/time/timestamp/min: (i : timestamp, j : timestamp) -> timestamp( ii: timestamp : timestampstd/time/timestamp/timestamp: V, jj: timestamp : timestampstd/time/timestamp/timestamp: V )result: -> total timestamp : timestampstd/time/timestamp/timestamp: V
if ii: timestamp <=std/time/timestamp/(<=): (i : timestamp, j : timestamp) -> bool jj: timestamp then ii: timestamp else jj: timestamp
pub fun maxstd/time/timestamp/max: (i : timestamp, j : timestamp) -> timestamp( ii: timestamp : timestampstd/time/timestamp/timestamp: V, jj: timestamp : timestampstd/time/timestamp/timestamp: V )result: -> total timestamp : timestampstd/time/timestamp/timestamp: V
if ii: timestamp >=std/time/timestamp/(>=): (i : timestamp, j : timestamp) -> bool jj: timestamp then ii: timestamp else jj: timestamp
pub fun (+)std/time/timestamp/(+): (ts : timestamp, t : timespan) -> timestamp( tsts: timestamp : timestampstd/time/timestamp/timestamp: V, tt: timespan : timespanstd/time/timestamp/timespan: V )result: -> total timestamp : timestampstd/time/timestamp/timestamp: V
Timestampstd/time/timestamp/Timestamp: (since : timespan, leap32 : int32) -> timestamp(tsts: timestamp.sincestd/time/timestamp/timestamp/since: (timestamp : timestamp) -> timespan +std/num/ddouble/(+): (x : ddouble, y : ddouble) -> ddouble tt: timespan, tsts: timestamp.leap32std/time/timestamp/timestamp/leap32: (timestamp : timestamp) -> int32)
pub fun (-)std/time/timestamp/(-): (ts : timestamp, t : timespan) -> timestamp( tsts: timestamp : timestampstd/time/timestamp/timestamp: V, tt: timespan : timespanstd/time/timestamp/timespan: V )result: -> total timestamp : timestampstd/time/timestamp/timestamp: V
Timestampstd/time/timestamp/Timestamp: (since : timespan, leap32 : int32) -> timestamp(tsts: timestamp.sincestd/time/timestamp/timestamp/since: (timestamp : timestamp) -> timespan -std/num/ddouble/(-): (x : ddouble, y : ddouble) -> ddouble tt: timespan, tsts: timestamp.leap32std/time/timestamp/timestamp/leap32: (timestamp : timestamp) -> int32)
pub fun ts-showstd/time/timestamp/ts-show: (ts : timestamp, max-prec : ? int, secs-width : ? int, unit : ? string) -> string( tsts: timestamp : timestampstd/time/timestamp/timestamp: V, max-precmax-prec: ? int : intstd/core/types/int: V = 9literal: int
dec = 9
hex8 = 0x09
bit8 = 0b00001001, secs-widthsecs-width: ? int : intstd/core/types/int: V = 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001, unitunit: ? string : stringstd/core/types/string: V = ""literal: string
count= 0 )result: -> total string : stringstd/core/types/string: V
val ll: string = if tsts: timestamp.leapstd/time/timestamp/leap: (t : timestamp) -> int.is-zerostd/core/int/is-zero: (x : int) -> bool then ""literal: string
count= 0 else " (+"literal: string
count= 3 ++std/core/types/(++): (x : string, y : string) -> string tsts: timestamp.leapstd/time/timestamp/leap: (t : timestamp) -> int.showstd/core/int/show: (i : int) -> string ++std/core/types/(++): (x : string, y : string) -> string " leap)"literal: string
count= 6
tsts: timestamp.sincestd/time/timestamp/timestamp/since: (timestamp : timestamp) -> timespan.show-secondsstd/time/date/show-seconds: (secs : ddouble, max-prec : ? int, secs-width : ? int, unit : ? string) -> string(max-precmax-prec: int,secs-widthsecs-width: int,unitunit: string) ++std/core/types/(++): (x : string, y : string) -> string ll: string
pub fun ts-show-daysstd/time/timestamp/ts-show-days: (ts : timestamp, prec : ? int) -> string( tsts: timestamp : timestampstd/time/timestamp/timestamp: V, precprec: ? int : intstd/core/types/int: V = 9literal: int
dec = 9
hex8 = 0x09
bit8 = 0b00001001 )result: -> total string : stringstd/core/types/string: V
val (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)daysdays: int,secssecs: ddouble)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) = tsts: timestamp.days-secondsstd/time/timestamp/days-seconds: (ts : timestamp) -> (int, ddouble)
daysdays: int.showstd/core/int/show: (i : int) -> string ++std/core/types/(++): (x : string, y : string) -> string "d "literal: string
count= 2 ++std/core/types/(++): (x : string, y : string) -> string ts-showstd/time/timestamp/ts-show: (ts : timestamp, max-prec : ? int, secs-width : ? int, unit : ? string) -> string(timestampstd/time/timestamp/timestamp: (t : timespan, leap : ? int) -> timestamp(secssecs: ddouble,tsts: timestamp.leapstd/time/timestamp/leap: (t : timestamp) -> int),precprec: int,unit="s"literal: string
count= 1)