| Integers and Floats | categories Primitives Dates and Times |
Chars |
Dates and times are represented using floats containing an UNIX C time that is the time in seconds since the Epoch (00:00:00 UTC, January 1, 1970). The use of float is required since CLAIRE integer are coded on 30 bits and times on 32 bits.
Internally, CLAIRE always handles dates represented in UTC. Times are referenced on the Epoch such the arithmetic between date and time can be made with the standard float arithmetic.
Two kind of timer are also supported, one that account time in the process time (time_set/time_get) and one that count in real time (timer!/elapsed).
| categories | Dates and Times | normal dispatch | [XL] Kernel method |
date_add(d, c, i) returns the date d incremented by i, where the unit of the increment depends on c :
| categories | Dates and Times | normal dispatch | [XL] Kernel method |
diff_time(d1, d2) returns the difference d1 - d2 in seconds.
| categories | Dates and Times | normal dispatch | [XL] Kernel method |
elapsed(t) returns the time in millisecond (accounted in real time) that has elapsed since the call to timer!()
| categories | Dates and Times | normal dispatch | [XL] Kernel method |
explode(t) explodes the calendar time t in integers. The returned value is a tuple made of :
| categories | Dates and Times | normal dispatch | [XL] Kernel method |
make_date(s) parses the string s and tries to create a date with it according to RFC 1123
| categories | Dates and Times | normal dispatch | [XL] Kernel method |
make_date(D,M,Y,h,m,s) returns the date D/M/Y h:m:s where months are one based index (M = 1 is January).
| categories | Dates and Times | normal dispatch | [XL] Kernel method |
make_time(s) parses the string s and tries to create a time with it
| categories | Dates and Times | normal dispatch | [XL] Kernel method |
returns the time constructed with the given hours, minutes and seconds
| categories | Dates and Times | normal dispatch | [XL] Kernel method |
strftime(f,d) is a wrapper for the C lib strftime. f may contain formatters introduced by the '%' (see man).
| categories | Dates and Times | normal dispatch | Core method |
time_get() stops a clock started by time_set() it and returns the elapsed time in milliseconds.
| categories | Dates and Times | normal dispatch | Core method |
time_set() starts a clock that will have to be stopped with time_get().
| categories | Dates and Times | normal dispatch | Core method |
time_show pretty prints the current value of a timer started by time_set().
| categories | Dates and Times | normal dispatch | [XL] Kernel method |
timer!() return the current date time in second with millisecond granularity. That is a real time clock is started, the returned value may be used with elapsed or uptime to get the time elapsed since the timer! call.
| categories | Dates and Times | normal dispatch | [XL] Kernel method |
uptime(x) prints on the current output a human readable version of the time elapsed (accounted in real time) since timer! with millisecond granularity.