std/time/date▲toc

Date, clock, and week days support.

Defines basic types for human readable time. Years, months, days etc. are always 1-based. Week dates are absent as they are treated as normal dates, using the cal-iso-week calendar.

struct clockstd/time/date/clock: V(hours : intstd/core/types/int: Vminutes : intstd/core/types/int: Vseconds : ddoublestd/num/ddouble/ddouble: V)

A clock consists of the hour, minute, second, and fractional second (between 0.0 and 1.0`).

Compare two clocks as by their total seconds.

Automatically generated. Retrieves the hours constructor field of the clockstd/time/date/clock: V type.

Automatically generated. Retrieves the minutes constructor field of the clockstd/time/date/clock: V type.

Automatically generated. Retrieves the seconds constructor field of the clockstd/time/date/clock: V type.

Show a clock in ISO format up to an optional maximum precision (=9).
Clock(23,30,fixed(1.123)).show == "23:30:01.123"
Clock(23,30,fixed(1.123)).show(0) == "23:30:01".

Create a clock from seconds; normalizes the clock with seconds and minutes under 60.

Create a clock from a seconds as an intstd/core/types/int: V with an optional fraction. Normalizes the clock with seconds and minutes under 60 but adds the fraction as is to the final seconds, so that might be >= 60 if the fraction >= 1.0;.

Create a clock from a seconds as an intstd/core/types/int: V with an optional fraction. Normalizes the clock with seconds and minutes under 60 but adds the fraction as is to the final seconds, so that might be >= 60 if the fraction >= 1.0;.

The zero clock.

Is this a zero clock?

Return the fraction of the seconds as milli-seconds (10-3).

Return the fraction of seconds as nano-seconds ((10-9).

Round a clock time to a certain number of digits precision (of the fraction of seconds) (default 9, nano seconds).

Return the total seconds of a clockstd/time/date/clock: V assuming 60 seconds per minute and 60 minutes per hour.

struct datestd/time/date/date: V(year : intstd/core/types/int: Vmonth : intstd/core/types/int: Vday : intstd/core/types/int: V)

A date consists of a the year, month, and day.

Automatically generated. Retrieves the day constructor field of the datestd/time/date/date: V type.

Automatically generated. Retrieves the month constructor field of the datestd/time/date/date: V type.

Automatically generated. Retrieves the year constructor field of the datestd/time/date/date: V type.

Add two dates field-wise together.

Compare two dates by fields.

Return the ISO calendar date of Easter in a given year (Algorithm by J.M. Oudin).

Show a date in ISO format. Datestd/time/date/Date: (year : int, month : int, day : int) -> date(2000,1,1).show == "2000-01-01". Takes an optional month-prefix (="") that is used by the ISO week and month calendar to add a "W" or "M" prefix respectively.

Create an ISO weekdate where the “month” is the ISO week number.

type weekdaystd/time/date/weekday: V

An ISO day of the week, starting at Monday (=1) up to Sunday (=7).

con Fri
con Mon
con Sat
con Sun
con Thu
con Tue
con Wed

Return the difference between two week days:
wd2 == wd1 + (wd2 - wd1).

Convert a weekdaystd/time/date/weekday: V to an intstd/core/types/int: V using the ISO definition which starts at Monday as 1, up to Sunday as 7.

Automatically generated. Tests for the Fristd/time/date/Fri: weekday constructor of the weekdaystd/time/date/weekday: V type.

Automatically generated. Tests for the Monstd/time/date/Mon: weekday constructor of the weekdaystd/time/date/weekday: V type.

Automatically generated. Tests for the Satstd/time/date/Sat: weekday constructor of the weekdaystd/time/date/weekday: V type.

Automatically generated. Tests for the Sunstd/time/date/Sun: weekday constructor of the weekdaystd/time/date/weekday: V type.

Automatically generated. Tests for the Thustd/time/date/Thu: weekday constructor of the weekdaystd/time/date/weekday: V type.

Automatically generated. Tests for the Tuestd/time/date/Tue: weekday constructor of the weekdaystd/time/date/weekday: V type.

Automatically generated. Tests for the Wedstd/time/date/Wed: weekday constructor of the weekdaystd/time/date/weekday: V type.

Convert a weekday number to a weekdaystd/time/date/weekday: V(starting at Monday (=1) up to Sunday (=7)). Takes the integer i - 1 modulo 7, so 0 or 14 also become Sunday etc.

fun show-seconds( secs : ddoublestd/num/ddouble/ddouble: V, max-prec : ? intstd/core/types/int: V, secs-width : ? intstd/core/types/int: V, unit : ? stringstd/core/types/string: V ) : stringstd/core/types/string: V

Show seconds.

fun show-year( year : intstd/core/types/int: V ) : stringstd/core/types/string: V

Show a year in ISO format (using 5+ digits and explicit sign for years < 0 or years > 9999)).

private import std/core/typesstd/core/types, std/core/hndstd/core/hnd, std/core/exnstd/core/exn, std/core/boolstd/core/bool, std/core/orderstd/core/order, std/core/charstd/core/char, std/core/intstd/core/int, std/core/vectorstd/core/vector, std/core/stringstd/core/string, std/core/sslicestd/core/sslice, std/core/liststd/core/list, std/core/maybestd/core/maybe, std/core/eitherstd/core/either, std/core/tuplestd/core/tuple, std/core/showstd/core/show, std/core/debugstd/core/debug, std/core/delayedstd/core/delayed, std/core/consolestd/core/console, std/corestd/core, std/num/float64std/num/float64, std/num/ddoublestd/num/ddouble