The TIME library¶
This time library is intended as a modernization of Open Dylan’s “date” module in the “system” library. It has a nanosecond precision and more efficient time representation, and a more complete API.
Current Status¶
This is alpha software.
It works only on Linux (possibly on macOS but it hasn’t been tried).
It works only on 64-bit machines.
It can get the current time, to nanosecond precision.
It can format times and durations.
Fixed-offset timezones work.
Support for “aware” timezones is underway. Support for TZif format is about half done.
The API should be considered provisional.
You have been warned. Enjoy!
Note
This documentation contains little more than the stubs auto-generated by export -format rst interface-reference. Use the sauce, Luke.
Reference¶
Each of the following constants is bound to the corresponding instance of
<month>
.
- $january Constant¶
- $february Constant¶
- $march Constant¶
- $april Constant¶
- $may Constant¶
- $june Constant¶
- $july Constant¶
- $august Constant¶
- $september Constant¶
- $october Constant¶
- $november Constant¶
- $december Constant¶
Each of the following constants is bound to the corresponding length of a
<duration>
. (Caveat emptor etc etc)
- $week Constant¶
- $day Constant¶
- $hour Constant¶
- $minute Constant¶
- $second Constant¶
- $millisecond Constant¶
- $microsecond Constant¶
- $nanosecond Constant¶
Each of the following constants is bound to the corresponding instance of
<day>
.
- $monday Constant¶
- $tuesday Constant¶
- $wednesday Constant¶
- $thursday Constant¶
- $friday Constant¶
- $saturday Constant¶
- $sunday Constant¶
Each of the following constants is an instance of <time-format>
.
- $rfc3339 Constant¶
- $rfc3339-microseconds Constant¶
- $rfc3339-milliseconds Constant¶
Each of the following constants is bound to the corresponding instance of
<time>
.
- $epoch Constant¶
- $minimum-time Constant¶
- $maximum-time Constant¶
- <day> Class¶
- <month> Class¶
- <time-error> Class¶
- Superclasses:
- <time-format> Class¶
- Superclasses:
- Init-Keywords:
parsed – An instance of
<sequence>
.string (required) – An instance of
<string>
.
- <time> Primary Class¶
- <zone> Abstract Class¶
- compose-time Generic function¶
- Signature:
compose-time (y mon d h min sec nano zone) => (_)
- Parameters:
- Values:
_ – An instance of
<time>
.
- day-long-name Generic function¶
- Signature:
day-long-name (object) => (value)
- Parameters:
object – An instance of
{<day> in time}
.
- Values:
value – An instance of
<string>
.
- day-short-name Generic function¶
- Signature:
day-short-name (object) => (value)
- Parameters:
object – An instance of
{<day> in time}
.
- Values:
value – An instance of
<string>
.
- duration-nanoseconds Generic function¶
- Signature:
duration-nanoseconds (object) => (value)
- Parameters:
object – An instance of
{<duration> in time}
.
- Values:
value – An instance of
<integer>
.
- find-zone Function¶
- format-duration Generic function¶
- Signature:
format-duration (stream duration #key long?) => ()
- Parameters:
stream – An instance of
<stream>
.duration – An instance of
<duration>
.long? (#key) – An instance of
<boolean>
.
- format-time Generic function¶
- format-time(<stream>, <time-format>, <time>) Method¶
- format-time(<stream>, <string>, <time>) Method¶
- format-time(<stream>, <sequence>, <time>) Method¶
- local-time-zone Generic function¶
- Signature:
local-time-zone () => (zone)
- Values:
zone – An instance of
<zone>
.
- month-days Generic function¶
- Signature:
month-days (object) => (value)
- Parameters:
object – An instance of
{<month> in time}
.
- Values:
value – An instance of
<integer>
.
- month-long-name Generic function¶
- Signature:
month-long-name (object) => (value)
- Parameters:
object – An instance of
{<month> in time}
.
- Values:
value – An instance of
<string>
.
- month-number Generic function¶
- Signature:
month-number (object) => (value)
- Parameters:
object – An instance of
{<month> in time}
.
- Values:
value – An instance of
<integer>
.
- month-short-name Generic function¶
- Signature:
month-short-name (object) => (value)
- Parameters:
object – An instance of
{<month> in time}
.
- Values:
value – An instance of
<string>
.
- parse-day Generic function¶
- parse-duration Generic function¶
- Signature:
parse-duration (s #key start end) => (d end-position)
- Parameters:
- Values:
d – An instance of
<duration>
.end-position – An instance of
<integer>
.
- parse-time Generic function¶
- Signature:
parse-time (input #key format zone) => (time)
- Parameters:
input – An instance of
<string>
.format (#key) – An instance of
<time-format>
.zone (#key) – An instance of
<zone>
.
- Values:
time – An instance of
<time>
.
- time-components Generic function¶
- Signature:
time-components (t #key zone) => (y mon d h min sec nano zone dow)
- Parameters:
t – An instance of
<time>
.zone (#key) – An instance of
<zone>?
.
- Values:
- time-day-of-month Generic function¶
- time-day-of-week Generic function¶
- time-hour Generic function¶
- time-in-zone Generic function¶
- time-minute Generic function¶
- time-month Generic function¶
- time-nanosecond Generic function¶
- time-now Generic function¶
- time-second Generic function¶
- time-year Generic function¶
- time-zone Generic function¶
- zone-abbreviation Generic function¶
- zone-abbreviation(<naive-zone>) Method¶
- zone-abbreviation(<aware-zone>) Method¶
- zone-daylight-savings? Generic function¶
- zone-daylight-savings?(<naive-zone>) Method¶
- zone-daylight-savings?(<aware-zone>) Method¶
- zone-name Generic function¶
- Signature:
zone-name (object) => (value)
- Parameters:
object – An instance of
{<zone> in time}
.
- Values:
value – An instance of
<string>
.
- zone-offset-seconds Generic function¶
- zone-offset-seconds(<naive-zone>) Method¶
- zone-offset-seconds(<aware-zone>) Method¶
- zone-offset-string Generic function¶
- zone-offset-string(<naive-zone>) Method¶
- zone-offset-string(<aware-zone>) Method¶