/*----------------------------------------------------------------------------
   Copyright 2012-2021, Microsoft Research, Daan Leijen

   Licensed under the Apache License, Version 2.0 ("The Licence"). You may not
   use this file except in compliance with the License. A copy of the License
   can be found in the LICENSE file at the root of this distribution.
----------------------------------------------------------------------------*/

// Formatting of time into a string.
module std/time/formatstd/time/format

import std/core/undivstd/core/undiv
import std/text/parsestd/text/parse
import std/num/ddoublestd/num/ddouble
import std/time/timestampstd/time/timestamp
import std/time/durationstd/time/duration
import std/time/instantstd/time/instant
import std/time/datestd/time/date
import std/time/calendarstd/time/calendar
import std/time/timestd/time/time
import std/time/localestd/time/locale

val fmt-iso-datestd/time/format/fmt-iso-date: string       = "YYYY-MM-DD"literal: string
count= 10
val fmt-iso-timestd/time/format/fmt-iso-time: string = "HH:mm:ssFFFFFFFFF"literal: string
count= 17
val fmt-iso-timezonestd/time/format/fmt-iso-timezone: string = "Z C"literal: string
count= 3
// Show a time as a standard ISO string. Will use automatic week date // or month date format for the `cal-iso-week` and `cal-iso-month` calendars. pub fun show-isostd/time/format/show-iso: (t : time) -> string( tt: time : timestd/time/time/time: V )result: -> total string : stringstd/core/types/string: V tt: time.show-iso-datestd/time/format/show-iso-date: (t : time) -> string ++std/core/types/(++): (x : string, y : string) -> string "T"literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> string tt: time.formatstd/time/format/format: (t : time, fmt : string, locale : ? time-locale) -> string(fmt-iso-timestd/time/format/fmt-iso-time: string ++std/core/types/(++): (x : string, y : string) -> string fmt-iso-timezonestd/time/format/fmt-iso-timezone: string
) // Show a time as a standard ISO date. Will use automatic week date // or month date format for the `cal-iso-week` and `cal-iso-month` calendars. pub fun show-iso-datestd/time/format/show-iso-date: (t : time) -> string( tt: time : timestd/time/time/time: V )result: -> total string : stringstd/core/types/string: V tt: time.formatstd/time/format/format: (t : time, fmt : string, locale : ? time-locale) -> string( fmt-iso-datestd/time/format/fmt-iso-date: string ) // Show time as a standard [Internet Message Format](https://tools.ietf.org/html/rfc2822#section-3.3) date.\ // For example `now().show-imf` returns `"Fri, 9 Oct 2016 11:57:45 -0700"` pub fun show-imfstd/time/format/show-imf: (t : time) -> string( tt: time : timestd/time/time/time: V )result: -> total string : stringstd/core/types/string: V tt: time.timestd/time/time/time/time: (t : time, tz : ? timezone, cal : ? calendar, ts : ? timescale) -> time(cal=cal-isostd/time/calendar/cal-iso: calendar).formatstd/time/format/format: (t : time, fmt : string, locale : ? time-locale) -> string("ddd, D MMM Y HH:mm:ss zz"literal: string
count= 24
) // Show the time as a human readable string in the given `locale` (=`time-locale-en`) // For example `now().show-en` -> `"Thu, 8 Oct 2016, 12:20pm"`. Uses the `"llll"` format string. pub fun show-in-localestd/time/format/show-in-locale: (t : time, locale : ? time-locale) -> string( tt: time : timestd/time/time/time: V, localelocale: ? time-locale : time-localestd/time/locale/time-locale: V = time-locale-enstd/time/locale/time-locale-en: time-locale )result: -> total string : stringstd/core/types/string: V tt: time.formatstd/time/format/format: (t : time, fmt : string, locale : ? time-locale) -> string("llll"literal: string
count= 4
,localelocale: time-locale
) // Show the date in human readable string in the given `locale` (=`time-locale-en`). // For example `now().show-en-date` -> `"Thu, 8 Oct 2016"`. Uses the `"ll"` format string. pub fun show-in-locale-datestd/time/format/show-in-locale-date: (t : time, locale : ? time-locale) -> string( tt: time : timestd/time/time/time: V, localelocale: ? time-locale : time-localestd/time/locale/time-locale: V = time-locale-enstd/time/locale/time-locale-en: time-locale )result: -> total string : stringstd/core/types/string: V tt: time.formatstd/time/format/format: (t : time, fmt : string, locale : ? time-locale) -> string("ll"literal: string
count= 2
,localelocale: time-locale
) // ----------------------------------------------------------- // Generic Formatting // ----------------------------------------------------------- fun format-weekdaystd/time/format/format-weekday: (t : time, n : int, locale : time-locale) -> string( tt: time : timestd/time/time/time: V, nn: int : intstd/core/types/int: V, localelocale: time-locale : time-localestd/time/locale/time-locale: V )result: -> total string : stringstd/core/types/string: V val wdwd: weekday = tt: time.weekdaystd/time/time/weekday: (t : time) -> weekday if nn: int==std/core/int/(==): (x : int, y : int) -> bool1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
then wdwd: weekday.showstd/time/date/weekday/show: (wd : weekday) -> string else val daysdays: list<string> = if nn: int==std/core/int/(==): (x : int, y : int) -> bool2literal: int
dec = 2
hex8 = 0x02
bit8 = 0b00000010
then localelocale: time-locale.day-names-minstd/time/locale/time-locale/day-names-min: (time-locale) -> list<string> elif nn: int==std/core/int/(==): (x : int, y : int) -> bool3literal: int
dec = 3
hex8 = 0x03
bit8 = 0b00000011
then localelocale: time-locale.day-names-shortstd/time/locale/time-locale/day-names-short: (time-locale) -> list<string> else localelocale: time-locale.day-namesstd/time/locale/time-locale/day-names: (time-locale) -> list<string> daysdays: list<string>[wdwd: weekday.intstd/time/date/int: (wd : weekday) -> int -std/core/int/(-): (x : int, y : int) -> int 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
].defaultstd/core/maybe/default: (m : maybe<string>, nothing : string) -> string("D"literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> string wdwd: weekday.showstd/time/date/weekday/show: (wd : weekday) -> string
) fun format-daystd/time/format/format-day: (t : time, n : int, locale : time-locale) -> string( tt: time : timestd/time/time/time: V, nn: int : intstd/core/types/int: V, localelocale: time-locale : time-localestd/time/locale/time-locale: V )result: -> total string : stringstd/core/types/string: V if nn: int==std/core/int/(==): (x : int, y : int) -> bool3literal: int
dec = 3
hex8 = 0x03
bit8 = 0b00000011
then tt: time.day-of-yearstd/time/time/day-of-year: (t : time) -> int.showlstd/time/format/showl: (i : int, width : ? int) -> string(3literal: int
dec = 3
hex8 = 0x03
bit8 = 0b00000011
) elif tt: time.calendarstd/time/time/time/calendar: (time : time) -> calendar.month-prefixstd/time/calendar/calendar/month-prefix: (calendar : calendar) -> string==std/core/string/(==): (string, string) -> bool"W"literal: string
count= 1
then tt: time.daystd/time/time/day: (t : time) -> int.showstd/core/int/show: (i : int) -> string else tt: time.daystd/time/time/day: (t : time) -> int.showlstd/time/format/showl: (i : int, width : ? int) -> string(nn: int
) fun format-monthstd/time/format/format-month: (t : time, n : int, locale : time-locale) -> string( tt: time : timestd/time/time/time: V, nn: int : intstd/core/types/int: V, localelocale: time-locale : time-localestd/time/locale/time-locale: V )result: -> total string : stringstd/core/types/string: V if nn: int<=std/core/int/(<=): (x : int, y : int) -> bool2literal: int
dec = 2
hex8 = 0x02
bit8 = 0b00000010
then tt: time.calendarstd/time/time/time/calendar: (time : time) -> calendar.month-prefixstd/time/calendar/calendar/month-prefix: (calendar : calendar) -> string ++std/core/types/(++): (x : string, y : string) -> string tt: time.monthstd/time/time/month: (t : time) -> int.showlstd/time/format/showl: (i : int, width : ? int) -> string(nn: int) else val monthsmonths: list<string> = if nn: int==std/core/int/(==): (x : int, y : int) -> bool3literal: int
dec = 3
hex8 = 0x03
bit8 = 0b00000011
then localelocale: time-locale.month-names-shortstd/time/locale/time-locale/month-names-short: (time-locale) -> list<string> else localelocale: time-locale.month-namesstd/time/locale/time-locale/month-names: (time-locale) -> list<string> monthsmonths: list<string>[tt: time.monthstd/time/time/month: (t : time) -> int -std/core/int/(-): (x : int, y : int) -> int 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
].defaultstd/core/maybe/default: (m : maybe<string>, nothing : string) -> string("M"literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> string tt: time.monthstd/time/time/month: (t : time) -> int.showlstd/time/format/showl: (i : int, width : ? int) -> string(2literal: int
dec = 2
hex8 = 0x02
bit8 = 0b00000010
)
) fun format-yearstd/time/format/format-year: (t : time, n : int, locale : time-locale) -> string( tt: time : timestd/time/time/time: V, nn: int : intstd/core/types/int: V, localelocale: time-locale : time-localestd/time/locale/time-locale: V )result: -> total string : stringstd/core/types/string: V if nn: int==std/core/int/(==): (x : int, y : int) -> bool1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
then tt: time.yearstd/time/time/year: (t : time) -> int.showstd/core/int/show: (i : int) -> string elif (nn: int<std/core/int/(<): (x : int, y : int) -> bool5literal: int
dec = 5
hex8 = 0x05
bit8 = 0b00000101
||std/core/types/(||): (x : bool, y : bool) -> bool (tt: time.yearstd/time/time/year: (t : time) -> int >=std/core/int/(>=): (x : int, y : int) -> bool 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
&&std/core/types/(&&): (x : bool, y : bool) -> bool tt: time.yearstd/time/time/year: (t : time) -> int <=std/core/int/(<=): (x : int, y : int) -> bool 9999literal: int
dec = 9999
hex16= 0x270F
bit16= 0b0010011100001111
)) then tt: time.yearstd/time/time/year: (t : time) -> int.absstd/core/int/abs: (i : int) -> int.showlstd/time/format/showl: (i : int, width : ? int) -> string(nn: int).laststd/core/sslice/last: (s : string, n : ? int) -> sslice(nn: int).stringstd/core/sslice/string: (slice : sslice) -> string else val yy: string = tt: time.yearstd/time/time/year: (t : time) -> int.absstd/core/int/abs: (i : int) -> int.showlstd/time/format/showl: (i : int, width : ? int) -> string(nn: int) if tt: time.yearstd/time/time/year: (t : time) -> int.is-negstd/core/int/is-neg: (i : int) -> bool then "-"literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> string yy: string else "+"literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> string
yy: string fun format-absyearstd/time/format/format-absyear: (t : time, n : int, locale : time-locale) -> string( tt: time : timestd/time/time/time: V, nn: int :intstd/core/types/int: V, localelocale: time-locale : time-localestd/time/locale/time-locale: V )result: -> total string : stringstd/core/types/string: V tt: time.yearstd/time/time/year: (t : time) -> int.absstd/core/int/abs: (i : int) -> int.showstd/core/int/show: (i : int) -> string fun format-erastd/time/format/format-era: (t : time, n : int, locale : time-locale) -> string( tt: time : timestd/time/time/time: V, nn: int : intstd/core/types/int: V, localelocale: time-locale : time-localestd/time/locale/time-locale: V )result: -> total string : stringstd/core/types/string: V (tt: time.calendarstd/time/time/time/calendar: (time : time) -> calendar.show-erastd/time/calendar/calendar/show-era: (calendar : calendar) -> ((date) -> string))(tt: time.datestd/time/time/time/date: (time : time) -> date) fun format-secondsstd/time/format/format-seconds: (t : time, n : int, locale : time-locale) -> string( tt: time : timestd/time/time/time: V, nn: int : intstd/core/types/int: V, localelocale: time-locale : time-localestd/time/locale/time-locale: V )result: -> total string : stringstd/core/types/string: V tt: time.secondsstd/time/time/seconds: (t : time) -> timespan.truncatestd/num/ddouble/truncate: (x : ddouble) -> ddouble.intstd/num/ddouble/int: (x : ddouble, nonfin : ? int) -> int.showlstd/time/format/showl: (i : int, width : ? int) -> string(nn: int) fun format-minutesstd/time/format/format-minutes: (t : time, n : int, locale : time-locale) -> string( tt: time : timestd/time/time/time: V, nn: int : intstd/core/types/int: V, localelocale: time-locale : time-localestd/time/locale/time-locale: V )result: -> total string : stringstd/core/types/string: V tt: time.minutesstd/time/time/minutes: (t : time) -> int.showlstd/time/format/showl: (i : int, width : ? int) -> string(nn: int) fun format-hoursstd/time/format/format-hours: (t : time, n : int, locale : time-locale) -> string( tt: time : timestd/time/time/time: V, nn: int : intstd/core/types/int: V, localelocale: time-locale : time-localestd/time/locale/time-locale: V )result: -> total string : stringstd/core/types/string: V tt: time.hoursstd/time/time/hours: (t : time) -> int.showlstd/time/format/showl: (i : int, width : ? int) -> string(nn: int) fun format-hours12std/time/format/format-hours12: (t : time, n : int, locale : time-locale) -> string( tt: time : timestd/time/time/time: V, nn: int : intstd/core/types/int: V, localelocale: time-locale : time-localestd/time/locale/time-locale: V )result: -> total string : stringstd/core/types/string: V val hh: int = tt: time.hoursstd/time/time/hours: (t : time) -> int if hh: int==std/core/int/(==): (x : int, y : int) -> bool0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
||std/core/types/(||): (x : bool, y : bool) -> bool hh: int==std/core/int/(==): (x : int, y : int) -> bool12literal: int
dec = 12
hex8 = 0x0C
bit8 = 0b00001100
then "12"literal: string
count= 2
elif hh: int<=std/core/int/(<=): (x : int, y : int) -> bool11literal: int
dec = 11
hex8 = 0x0B
bit8 = 0b00001011
then hh: int.showlstd/time/format/showl: (i : int, width : ? int) -> string(nn: int) else (hh: int -std/core/int/(-): (x : int, y : int) -> int 12literal: int
dec = 12
hex8 = 0x0C
bit8 = 0b00001100
).showlstd/time/format/showl: (i : int, width : ? int) -> string(nn: int
) fun format-calnamestd/time/format/format-calname: (t : time, n : int, locale : time-locale) -> string( tt: time : timestd/time/time/time: V, nn: int : intstd/core/types/int: V, localelocale: time-locale : time-localestd/time/locale/time-locale: V)result: -> total string : stringstd/core/types/string: V if tt: time.calendarstd/time/time/time/calendar: (time : time) -> calendar.month-prefixstd/time/calendar/calendar/month-prefix: (calendar : calendar) -> string.is-notemptystd/core/string/is-notempty: (s : string) -> bool then ""literal: string
count= 0
elif nn: int==std/core/int/(==): (x : int, y : int) -> bool2literal: int
dec = 2
hex8 = 0x02
bit8 = 0b00000010
then tt: time.calendarstd/time/time/time/calendar: (time : time) -> calendar.long-namestd/time/calendar/calendar/long-name: (calendar : calendar) -> string else tt: time.calendarstd/time/time/time/calendar: (time : time) -> calendar.namestd/time/calendar/calendar/name: (calendar : calendar) -> string
fun format-ampmstd/time/format/format-ampm: (t : time, n : int, locale : time-locale) -> string( tt: time : timestd/time/time/time: V, nn: int : intstd/core/types/int: V, localelocale: time-locale : time-localestd/time/locale/time-locale: V )result: -> total string : stringstd/core/types/string: V val hh: int = tt: time.hoursstd/time/time/hours: (t : time) -> int (if hh: int<=std/core/int/(<=): (x : int, y : int) -> bool11literal: int
dec = 11
hex8 = 0x0B
bit8 = 0b00001011
then "am"literal: string
count= 2
else "pm"literal: string
count= 2
).firststd/core/sslice/first: (s : string, n : ? int) -> sslice(nn: int).stringstd/core/sslice/string: (slice : sslice) -> string
fun format-upper-ampmstd/time/format/format-upper-ampm: (t : time, n : int, locale : time-locale) -> string( tt: time : timestd/time/time/time: V, nn: int : intstd/core/types/int: V, localelocale: time-locale : time-localestd/time/locale/time-locale: V )result: -> total string : stringstd/core/types/string: V format-ampmstd/time/format/format-ampm: (t : time, n : int, locale : time-locale) -> string(tt: time,nn: int,localelocale: time-locale).to-upperstd/core/string/to-upper: (s : string) -> string fun format-fracstd/time/format/format-frac: (t : time, n : int, locale : time-locale) -> string( tt: time : timestd/time/time/time: V, nn: int : intstd/core/types/int: V, localelocale: time-locale : time-localestd/time/locale/time-locale: V )result: -> total string : stringstd/core/types/string: V val fracfrac: ddouble = tt: time.secondsstd/time/time/seconds: (t : time) -> timespan.fractionstd/num/ddouble/fraction: (x : ddouble) -> ddouble if fracfrac: ddouble.is-zerostd/num/ddouble/is-zero: (x : ddouble) -> bool then ""literal: string
count= 0
else fracfrac: ddouble.show-fixedstd/num/ddouble/show-fixed: (x : ddouble, prec : ? int) -> string(nn: int).tailstd/core/sslice/tail: (s : string) -> string
fun format-frac0std/time/format/format-frac0: (t : time, n : int, locale : time-locale) -> string( tt: time : timestd/time/time/time: V, nn: int : intstd/core/types/int: V, localelocale: time-locale : time-localestd/time/locale/time-locale: V )result: -> total string : stringstd/core/types/string: V val fracfrac: ddouble = tt: time.secondsstd/time/time/seconds: (t : time) -> timespan.fractionstd/num/ddouble/fraction: (x : ddouble) -> ddouble if fracfrac: ddouble.is-zerostd/num/ddouble/is-zero: (x : ddouble) -> bool then ""literal: string
count= 0
else fracfrac: ddouble.show-fixedstd/num/ddouble/show-fixed: (x : ddouble, prec : ? int) -> string(nn: int).tailstd/core/sslice/tail: (s : string) -> string.pad-rightstd/core/string/pad-right: (s : string, width : int, fill : ? char) -> string(nn: int+std/core/int/(+): (x : int, y : int) -> int1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
,'0'literal: char
unicode= u0030
) fun format-tz-offsetstd/time/format/format-tz-offset: (t : time, n : int, hmsep : string, utc : string) -> string( tt: time : timestd/time/time/time: V, nn: int : intstd/core/types/int: V, hmsephmsep: string : stringstd/core/types/string: V, utcutc: string : stringstd/core/types/string: V )result: -> total string : stringstd/core/types/string: V show-tzdeltastd/time/time/show-tzdelta: (delta : duration, utc : ? string, hmsep : ? string, hrwidth : ? int) -> string(tt: time.tzdeltastd/time/time/time/tzdelta: (time : time) -> duration,hmsep=hmsephmsep: string,utc=utcutc: string) fun format-timezonestd/time/format/format-timezone: (t : time, n : int, locale : time-locale) -> string( tt: time : timestd/time/time/time: V, nn: int : intstd/core/types/int: V, localelocale: time-locale : time-localestd/time/locale/time-locale: V )result: -> total string : stringstd/core/types/string: V format-tz-offsetstd/time/format/format-tz-offset: (t : time, n : int, hmsep : string, utc : string) -> string(tt: time,nn: int,if nn: int==std/core/int/(==): (x : int, y : int) -> bool2literal: int
dec = 2
hex8 = 0x02
bit8 = 0b00000010
then ""literal: string
count= 0
else ":"literal: string
count= 1
,if nn: int==std/core/int/(==): (x : int, y : int) -> bool2literal: int
dec = 2
hex8 = 0x02
bit8 = 0b00000010
then "+0000"literal: string
count= 5
else "+00:00"literal: string
count= 6
) fun format-utc-timezonestd/time/format/format-utc-timezone: (t : time, n : int, locale : time-locale) -> string( tt: time : timestd/time/time/time: V, nn: int : intstd/core/types/int: V, localelocale: time-locale : time-localestd/time/locale/time-locale: V )result: -> total string : stringstd/core/types/string: V format-tz-offsetstd/time/format/format-tz-offset: (t : time, n : int, hmsep : string, utc : string) -> string(tt: time,nn: int,":"literal: string
count= 1
,if nn: int==std/core/int/(==): (x : int, y : int) -> bool2literal: int
dec = 2
hex8 = 0x02
bit8 = 0b00000010
then ""literal: string
count= 0
else "Z"literal: string
count= 1
) fun format-timestampstd/time/format/format-timestamp: (t : time, n : int, locale : time-locale) -> string( tt: time : timestd/time/time/time: V, nn: int : intstd/core/types/int: V, localelocale: time-locale : time-localestd/time/locale/time-locale: V )result: -> total string : stringstd/core/types/string: V tt: time.instantstd/time/time/time/instant: (time : time) -> instant.show-rawstd/time/instant/show-raw: (i : instant, max-prec : ? int, secs-width : ? int, unit : ? string) -> string(3literal: int
dec = 3
hex8 = 0x03
bit8 = 0b00000011
) val formatsstd/time/format/formats: list<(char, int, (time, int, time-locale) -> string)> : liststd/core/types/list: V -> V<(std/core/types/tuple3: (V, V, V) -> Vcharstd/core/types/char: V,intstd/core/types/int: V,(timestd/time/time/time: V,intstd/core/types/int: V,time-localestd/time/locale/time-locale: V) -> stringstd/core/types/string: V)> = [std/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a> (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)'Y'literal: char
unicode= u0059
, 6literal: int
dec = 6
hex8 = 0x06
bit8 = 0b00000110
, format-yearstd/time/format/format-year: (t : time, n : int, locale : time-locale) -> string)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c), (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)'M'literal: char
unicode= u004D
, 4literal: int
dec = 4
hex8 = 0x04
bit8 = 0b00000100
, format-monthstd/time/format/format-month: (t : time, n : int, locale : time-locale) -> string)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c), (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)'D'literal: char
unicode= u0044
, 3literal: int
dec = 3
hex8 = 0x03
bit8 = 0b00000011
, format-daystd/time/format/format-day: (t : time, n : int, locale : time-locale) -> string)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c), (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)'H'literal: char
unicode= u0048
, 2literal: int
dec = 2
hex8 = 0x02
bit8 = 0b00000010
, format-hoursstd/time/format/format-hours: (t : time, n : int, locale : time-locale) -> string)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c), (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)'m'literal: char
unicode= u006D
, 2literal: int
dec = 2
hex8 = 0x02
bit8 = 0b00000010
, format-minutesstd/time/format/format-minutes: (t : time, n : int, locale : time-locale) -> string)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c), (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)'s'literal: char
unicode= u0073
, 2literal: int
dec = 2
hex8 = 0x02
bit8 = 0b00000010
, format-secondsstd/time/format/format-seconds: (t : time, n : int, locale : time-locale) -> string)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c), (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)'z'literal: char
unicode= u007A
, 2literal: int
dec = 2
hex8 = 0x02
bit8 = 0b00000010
, format-timezonestd/time/format/format-timezone: (t : time, n : int, locale : time-locale) -> string)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c), (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)'Z'literal: char
unicode= u005A
, 2literal: int
dec = 2
hex8 = 0x02
bit8 = 0b00000010
, format-utc-timezonestd/time/format/format-utc-timezone: (t : time, n : int, locale : time-locale) -> string)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c), (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)'f'literal: char
unicode= u0066
, 8literal: int
dec = 8
hex8 = 0x08
bit8 = 0b00001000
, format-frac0std/time/format/format-frac0: (t : time, n : int, locale : time-locale) -> string)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c), (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)'F'literal: char
unicode= u0046
, 8literal: int
dec = 8
hex8 = 0x08
bit8 = 0b00001000
, format-fracstd/time/format/format-frac: (t : time, n : int, locale : time-locale) -> string)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c), (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)'C'literal: char
unicode= u0043
, 2literal: int
dec = 2
hex8 = 0x02
bit8 = 0b00000010
, format-calnamestd/time/format/format-calname: (t : time, n : int, locale : time-locale) -> string)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c), (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)'E'literal: char
unicode= u0045
, 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
, format-erastd/time/format/format-era: (t : time, n : int, locale : time-locale) -> string)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c), (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)'y'literal: char
unicode= u0079
, 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
, format-absyearstd/time/format/format-absyear: (t : time, n : int, locale : time-locale) -> string)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c), (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)'d'literal: char
unicode= u0064
, 4literal: int
dec = 4
hex8 = 0x04
bit8 = 0b00000100
, format-weekdaystd/time/format/format-weekday: (t : time, n : int, locale : time-locale) -> string)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c), (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)'h'literal: char
unicode= u0068
, 2literal: int
dec = 2
hex8 = 0x02
bit8 = 0b00000010
, format-hours12std/time/format/format-hours12: (t : time, n : int, locale : time-locale) -> string)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c), (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)'a'literal: char
unicode= u0061
, 2literal: int
dec = 2
hex8 = 0x02
bit8 = 0b00000010
, format-ampmstd/time/format/format-ampm: (t : time, n : int, locale : time-locale) -> string)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c), (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)'A'literal: char
unicode= u0041
, 2literal: int
dec = 2
hex8 = 0x02
bit8 = 0b00000010
, format-upper-ampmstd/time/format/format-upper-ampm: (t : time, n : int, locale : time-locale) -> string)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c), (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)'x'literal: char
unicode= u0078
, 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
, format-timestampstd/time/format/format-timestamp: (t : time, n : int, locale : time-locale) -> string)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c),
]std/core/types/Nil: forall<a> list<a> /* Format a time according to format string `fmt` and using a optional time locale (= `time-locale-en-iso`). Letters (``a`` to ``z``) are always interpreted as a pattern where unknown letter patterns are ignored. Any literal text should be quote-escaped i.e. use `"'GMT'ZZ"` to display as `"GMT-07:00"` (in the PST time zone). Any characters other then an ascii letter are displayed as is. Patterns of 2 letters are zero-padded on the left to always display as 2 digits. Allowed patterns: * ``Y``: the year as a number (without zero padding) (``1970``, ``203``) * ``YY``, ```YYYY``: the year in upto 4 digits (``70``, ``1970``, ``0203``). If the year is smaller than zero or larger than 9999, the year is displayed with 5 or more digits and preprended with an explicit sign (``-00030``, ``+10345``). * ``M``, ``MM``: the month. (``1``, ``03``). In case of an ISO week (`cal-iso-week`) or ISO month (`cal-iso-month`) calendar, the month is prefixed with ``W`` or ``M``. * ``MMM``, ``MMMM``: name of the month in the specified `locale`. (``Jan``, ``January``) * ``D``, ``DD``: the day of the month. (``1``, ``08``). If ``DD`` is used and this is an ISO week calendar (`cal-iso-week`) just one digit is used for the week day. * ``DDD``: the day of the year. (``087``) * ``d``: the ISO day of the week, 1 for Monday ending in 7 for Sunday. * ``dd``, ``ddd``,``dddd``: the day of the week in the current `locale`. (``We``,``Wed``,``Wednesday``) * ``h``, ``hh``: the hours using a 12-hour clock (with am/pm). (``9``, ``09``) * ``H``, ``HH``: the hours using a 24-hour clock. (``21``, ``09``) * ``m``, ``mm``: the minutes. (``9``, ``09``) * ``s``, ``ss``: the whole seconds. (``8``, ``08``) * ``a``, ``aa``: AM/PM designation. (``a``, ``am``) * ``A``, ``AA``: AM/PM designation in upper-case. (``A``, ``AM``) * ``f``,...,``fffffffff``: upto 9 digits of a fraction of a second. Starts with a dot. (``.320``, ``.000``) * ``F``,...,``FFFFFFFFF``: upto 9 digits of a fraction of a second. If not zero, starts with a dot. In contrast to the ``f`` patterns displays the minimal number of required digits (and is not right-padded with zeros). (``.32``) * ``z``: timezone offset in hours and minutes separated by a colon. Use ``+00:00`` for UTC time. (``+01:00``) * ``zz``: timezone offset in hours and minutes without a separator. Use ``+0000`` for UTC time. (``-0700``) * ``Z``: timezone offset in hours and minutes separated by a colon, use ``Z`` for UTC time. * ``ZZ``: timezone offset in hours and minutes separated by colon, use an empty string for UTC time. * ``x``: fractional seconds since `min-time`. (``63610768799.429``) * ``YYYYYY``: the year in [ECMAscript](https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15.1) 6 digits, prepended with the sign. (``+002016``,``-000023``,``+000000``) * ``y``: the absolute value of the year as a number (without zero padding). Useful when displaying Julian (`cal-julian`) negative years as ``10 BC`` for example (e.g. ``"y E"``). * ``C``, ``CC``: the short or long calendar name. (The short name is empty for the standard ISO calendars). * ``E``: the era name, for example ``CE`` for the Gregorian calendar. * ``'...'``, ``"..."``: anything between quotes is displayed as is. (``'M'M`` becomes ``M11`` for November) There are also various forms to display dates and times in a locale specific way. We give examples in English and Dutch. The lower-case ``l`` variants use short names for month- and day names. * ``t``: hours and minutes (``3:21pm, 15:21``) * ``tt``: hours, minutes, and seconds (``3:21:01pm, 15:21:01``) * ``L``, ``l``: a date (``09/29/2016, 29.09.2016``) and (``9/29/2016, 29.9.2016``) * ``LL``, ``ll``: date with month name (``29 September 2016, 29 september 2016``) and (``29 Sep 2016, 29 sep 2016``) * ``LLL``, ``lll``: date with month name and time (``29 September 2016 1:15pm, 29 september 2016 13:15``) * ``LLLL``, ``llll``: date with day name, month name, and time (``Thursday, 29 September 2016 1:15pm``) and (``Thu, 29 Sep 2016 1:15pm``) After formatting, any left- or right white space is trimmed. This allows specifiers like `"YYYY E C"` that display correctly even if the era or calendar name is empty. For example, to display a time in the standard [Internet Message Format](https://tools.ietf.org/html/rfc2822#section-3.3) you can use `now().format("ddd, D MMM Y HH:mm:ss zz")` displayed as `"Tue, 27 Sep 2016 06:36:55 -0700"` for example.\ A standard ISO string can be formatted as, `"YYYY-MM-DD'T'HH:mm:ssFFFFFFFFFZ C"`. */ pub fun formatstd/time/format/format: (t : time, fmt : string, locale : ? time-locale) -> string( tt: time : timestd/time/time/time: V, fmtfmt: string : stringstd/core/types/string: V, localelocale: ? time-locale : time-localestd/time/locale/time-locale: V = time-locale-en-isostd/time/locale/time-locale-en-iso: time-locale )result: -> total string : stringstd/core/types/string: V format-liststd/time/format/format-list: (t : time, fmt : list<char>, locale : time-locale) -> string( tt: time, fmtfmt: string.expand-localesstd/time/format/expand-locales: (fmt : string, locale : time-locale) -> string(localelocale: time-locale).expand-localesstd/time/format/expand-locales: (fmt : string, locale : time-locale) -> string(localelocale: time-locale).liststd/core/string/list: (s : string) -> list<char>, localelocale: time-locale ) fun format-liststd/time/format/format-list: (t : time, fmt : list<char>, locale : time-locale) -> string( tt: time : timestd/time/time/time: V, fmtfmt: list<char> : liststd/core/types/list: V -> V<charstd/core/types/char: V>, localelocale: time-locale : time-localestd/time/locale/time-locale: V )result: -> total string : stringstd/core/types/string: V match fmtfmt: list<char> Nilstd/core/types/Nil: forall<a> list<a> -> ""literal: string
count= 0
Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(cc: char,cscs: list<char>) -> val (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)formattedformatted: string,restrest: list<char>)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) = format-patstd/time/format/format-pat: (t : time, h : char, fmt : list<char>, locale : time-locale) -> (string, list<char>)(tt: time,cc: char,cscs: list<char>,localelocale: time-locale) formattedformatted: string ++std/core/types/(++): (x : string, y : string) -> string format-liststd/time/format/format-list: (t : time, fmt : list<char>, locale : time-locale) -> string(tt: time, pretend-decreasingstd/core/undiv/pretend-decreasing: (x : list<char>) -> list<char>(restrest: list<char>), localelocale: time-locale
) fun format-patstd/time/format/format-pat: (t : time, h : char, fmt : list<char>, locale : time-locale) -> (string, list<char>)( tt: time : timestd/time/time/time: V, hh: char : charstd/core/types/char: V, fmtfmt: list<char> : liststd/core/types/list: V -> V<charstd/core/types/char: V>, localelocale: time-locale : time-localestd/time/locale/time-locale: V )result: -> total (string, list<char>) : (std/core/types/tuple2: (V, V) -> Vstringstd/core/types/string: V,liststd/core/types/list: V -> V<charstd/core/types/char: V>) if hh: char==std/core/char/(==): (char, char) -> bool'"'literal: char
unicode= u0022
||std/core/types/(||): (x : bool, y : bool) -> bool hh: char==std/core/char/(==): (char, char) -> bool'\''literal: char
unicode= u0027
then // extract escaped part val (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)quotedquoted: list<char>,endend: list<char>)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) = fmtfmt: list<char>.spanstd/core/list/span: (xs : list<char>, predicate : (char) -> bool) -> (list<char>, list<char>)( fnfn: (c : char) -> bool(cc: char){ cc: char!=std/core/char/(!=): (char, char) -> boolhh: char } ) match endend: list<char> Nilstd/core/types/Nil: forall<a> list<a> -> (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)hh: char.stringstd/core/string/char/string: (c : char) -> string, fmtfmt: list<char>)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(_,restrest: list<char>) -> (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)quotedquoted: list<char>.stringstd/core/string/listchar/string: (cs : list<char>) -> string, restrest: list<char>)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) elif hh: char.is-alphastd/core/char/is-alpha: (c : char) -> bool then // match pattern val (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)hshs: list<char>,restrest: list<char>)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) = fmtfmt: list<char>.spanstd/core/list/span: (xs : list<char>, predicate : (char) -> bool) -> (list<char>, list<char>)(fnfn: (c : char) -> bool(cc: char){cc: char==std/core/char/(==): (char, char) -> boolhh: char}) val nn: int = hshs: list<char>.lengthstd/core/list/length: (xs : list<char>) -> int +std/core/int/(+): (x : int, y : int) -> int 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
formatsstd/time/format/formats: list<(char, int, (time, int, time-locale) -> string)>.foreach-whilestd/core/list/foreach-while: (xs : list<(char, int, (time, int, time-locale) -> string)>, action : ((char, int, (time, int, time-locale) -> string)) -> maybe<(string, list<char>)>) -> maybe<(string, list<char>)> fnfn: (pattern : (char, int, (time, int, time-locale) -> string)) -> maybe<(string, list<char>)>(patternpattern: (char, int, (time, int, time-locale) -> string)) val (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)cc: char,mm: int,ff: (time, int, time-locale) -> string)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c) = patternpattern: (char, int, (time, int, time-locale) -> string) if cc: char!=std/core/char/(!=): (char, char) -> boolhh: char then Nothingstd/core/types/Nothing: forall<a> maybe<a> else Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>((std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)ff: (time, int, time-locale) -> string(tt: time,minstd/core/int/min: (i : int, j : int) -> int(nn: int,mm: int),localelocale: time-locale), restrest: list<char>)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)) .defaultstd/core/maybe/default: (m : maybe<(string, list<char>)>, nothing : (string, list<char>)) -> (string, list<char>)( (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)""literal: string
count= 0
,restrest: list<char>)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) ) // ignore if no match else (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)hh: char.stringstd/core/string/char/string: (c : char) -> string,fmtfmt: list<char>
)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) // return as-is /* fun expand-locales( fmt : string, locale : time-locale ) : string fmt.replace-all(rx-locale) fn(cap) val n = cap.matched.count if cap.groups[1] != "" then cap.matched elif cap.groups[2] != "" then if n>=2 then locale.format-tt else locale.format-t else val nfmt = if n>=4 then locale.format-llll elif n==3 then locale.format-lll elif n==2 then locale.format-ll else locale.format-l if cap.groups[3] != "" then nfmt else nfmt.replace-all(rx-long, fn(capl) { capl.matched.tail }) val rx-locale = regex(r"('[^']*'|""[^""]*"")|(t+)|(L+)|(l+)") val rx-long = regex(r"dddd+|MMMM+|DD(?!D)") */ fun expand-localesstd/time/format/expand-locales: (fmt : string, locale : time-locale) -> string( fmtfmt: string : stringstd/core/types/string: V, localelocale: time-locale : time-localestd/time/locale/time-locale: V )result: -> total string : stringstd/core/types/string: V fmtfmt: string.slicestd/core/sslice/slice: (s : string) -> sslice.parse-eofstd/text/parse/parse-eof: (input : sslice, p : () -> parse string) -> parse-error<string>( { plocalesstd/time/format/plocales: (locale : time-locale) -> parse string(localelocale: time-locale) } ).maybestd/text/parse/maybe: (perr : parse-error<string>) -> maybe<string>.defaultstd/core/maybe/default: (m : maybe<string>, nothing : string) -> string(fmtfmt: string) fun plocalesstd/time/format/plocales: (locale : time-locale) -> parse string( localelocale: time-locale : time-localestd/time/locale/time-locale: V )result: -> parse string : parsestd/text/parse/parse: (E, V) -> V stringstd/core/types/string: V manystd/text/parse/many: (p : parser<total,string>) -> parse list<string>({plocalestd/time/format/plocale: (locale : time-locale) -> parse string(localelocale: time-locale)}).joinstd/core/list/join: (xs : list<string>) -> parse string fun plocalestd/time/format/plocale: (locale : time-locale) -> parse string( localelocale: time-locale : time-localestd/time/locale/time-locale: V )result: -> parse string : parsestd/text/parse/parse: (E, V) -> V stringstd/core/types/string: V choosestd/text/parse/choose: (ps : list<parser<total,string>>) -> parse string([std/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a> { none-of-many1std/text/parse/none-of-many1: (chars : string) -> parse string("'\"tLl"literal: string
count= 5
) }, { pquotedstd/time/format/pquoted: (quote : char) -> parse string('\''literal: char
unicode= u0027
) }, { pquotedstd/time/format/pquoted: (quote : char) -> parse string('"'literal: char
unicode= u0022
) }, { plocale-tstd/time/format/plocale-t: (locale : time-locale) -> parse string(localelocale: time-locale) }, { plocale-lstd/time/format/plocale-l: (locale : time-locale, l : char) -> parse string(localelocale: time-locale,'L'literal: char
unicode= u004C
) }, { plocale-lstd/time/format/plocale-l: (locale : time-locale, l : char) -> parse string(localelocale: time-locale,'l'literal: char
unicode= u006C
) } ]std/core/types/Nil: forall<a> list<a>
) fun pquotedstd/time/format/pquoted: (quote : char) -> parse string(quotequote: char : charstd/core/types/char: V)result: -> parse string : parsestd/text/parse/parse: (E, V) -> V stringstd/core/types/string: V charstd/text/parse/char: (c : char) -> parse char(quotequote: char) val ss: string = optionalstd/text/parse/optional: (default : string, p : parser<total,string>) -> parse string(""literal: string
count= 0
){ chars-arestd/text/parse/chars-are: (msg : string, pred : (char) -> bool) -> parse list<char>(""literal: string
count= 0
,fnfn: (c : char) -> bool(cc: char){ cc: char !=std/core/char/(!=): (char, char) -> bool quotequote: char } ).stringstd/core/string/listchar/string: (cs : list<char>) -> parse string } charstd/text/parse/char: (c : char) -> parse char(quotequote: char) returnreturn: string (quotequote: char.stringstd/core/string/char/string: (c : char) -> parse string ++std/core/types/(++): (x : string, y : string) -> parse string ss: string ++std/core/types/(++): (x : string, y : string) -> parse string quotequote: char.stringstd/core/string/char/string: (c : char) -> parse string
) fun plocale-tstd/time/format/plocale-t: (locale : time-locale) -> parse string( localelocale: time-locale : time-localestd/time/locale/time-locale: V )result: -> parse string : parsestd/text/parse/parse: (E, V) -> V stringstd/core/types/string: V charstd/text/parse/char: (c : char) -> parse char('t'literal: char
unicode= u0074
) optionalstd/text/parse/optional: (default : string, p : parser<total,string>) -> parse string(localelocale: time-locale.format-tstd/time/locale/time-locale/format-t: (time-locale) -> parse string){ charstd/text/parse/char: (c : char) -> parse char('t'literal: char
unicode= u0074
); localelocale: time-locale.format-ttstd/time/locale/time-locale/format-tt: (time-locale) -> parse string
} fun plocale-lstd/time/format/plocale-l: (locale : time-locale, l : char) -> parse string( localelocale: time-locale : time-localestd/time/locale/time-locale: V, ll: char : charstd/core/types/char: V )result: -> parse string : parsestd/text/parse/parse: (E, V) -> V stringstd/core/types/string: V val lsls: list<char> = many1std/text/parse/many1: (p : parser<total,char>) -> parse list<char>{ charstd/text/parse/char: (c : char) -> parse char(ll: char) } val nn: int = lsls: list<char>.lengthstd/core/list/length: (xs : list<char>) -> parse int val nfmtnfmt: string = if nn: int>=std/core/int/(>=): (x : int, y : int) -> parse bool4literal: int
dec = 4
hex8 = 0x04
bit8 = 0b00000100
then localelocale: time-locale.format-llllstd/time/locale/time-locale/format-llll: (time-locale) -> parse string elif nn: int==std/core/int/(==): (x : int, y : int) -> parse bool3literal: int
dec = 3
hex8 = 0x03
bit8 = 0b00000011
then localelocale: time-locale.format-lllstd/time/locale/time-locale/format-lll: (time-locale) -> parse string elif nn: int==std/core/int/(==): (x : int, y : int) -> parse bool2literal: int
dec = 2
hex8 = 0x02
bit8 = 0b00000010
then localelocale: time-locale.format-llstd/time/locale/time-locale/format-ll: (time-locale) -> parse string else localelocale: time-locale.format-lstd/time/locale/time-locale/format-l: (time-locale) -> parse string if ll: char==std/core/char/(==): (char, char) -> parse bool'L'literal: char
unicode= u004C
then nfmtnfmt: string else nfmtnfmt: string.replace-allstd/core/string/replace-all: (s : string, pattern : string, repl : string) -> parse string("dd"literal: string
count= 2
,"d"literal: string
count= 1
).replace-allstd/core/string/replace-all: (s : string, pattern : string, repl : string) -> parse string("dd"literal: string
count= 2
,"ddd"literal: string
count= 3
) .replace-allstd/core/string/replace-all: (s : string, pattern : string, repl : string) -> parse string("MM"literal: string
count= 2
,"M"literal: string
count= 1
).replace-allstd/core/string/replace-all: (s : string, pattern : string, repl : string) -> parse string("MM"literal: string
count= 2
,"MMM"literal: string
count= 3
) .replace-allstd/core/string/replace-all: (s : string, pattern : string, repl : string) -> parse string("DD"literal: string
count= 2
,"D"literal: string
count= 1
).replace-allstd/core/string/replace-all: (s : string, pattern : string, repl : string) -> parse string("DD"literal: string
count= 2
,"DDD"literal: string
count= 3
) fun showlstd/time/format/showl: (i : int, width : ? int) -> string( ii: int : intstd/core/types/int: V, widthwidth: ? int : intstd/core/types/int: V = 2literal: int
dec = 2
hex8 = 0x02
bit8 = 0b00000010
)result: -> total string : stringstd/core/types/string: V ii: int.showstd/core/int/show: (i : int) -> string.pad-leftstd/core/string/pad-left: (s : string, width : int, fill : ? char) -> string(widthwidth: int,'0'literal: char
unicode= u0030
)