Time is an abstraction of dates and times.
This module implements the
Time class from Ruby Core.
In Artichoke, Time is represented as a 64-bit signed integer of seconds since January 1, 1970 UTC (the Unix Epoch) and an unsigned 32-bit integer of subsecond nanoseconds. This allows representing roughly 584 billion years.
You can use this class in your application by accessing it directly. As a Core class, it is globally available:
This implementation of
Time is dependent on the selected feature. The
chrono feature uses the
chrono crate, and the tzrs feature uses
tzdb crate for getting the local timezone information, and combines
tz-rs crate to generate the time.
This crate supports two backends which are independent of each other. The availability of different backends is controlled by Cargo features, all of which are enabled by default:
- chrono: Enable a
Timebackend which is implemented with the
- tzrs: Enable a
Timebackend which is implemented by the
tzrs-local: Enable the detection of the system timezone with the tzrs backend. This feature is enabled by default. Enabling this feature also activates the tzrs feature.
If the tzrs-local feature is disabled, the local timezone is defaulted to GMT (not UTC).
This crate requires
std, the Rust Standard Library.