ako 0.0.2

Ako is a Rust crate that offers a practical and human-friendly approach to creating, manipulating, formatting and converting dates, times and timestamps.
Documentation
ako-0.0.2 has been yanked.

Ako

Ako 🕐 is a Rust crate that offers a practical and human-friendly approach to creating, manipulating, formatting and converting dates, times and timestamps.

  • Fast. 🐎 Ako screams. The most common algorithms have been aggressively researched and refined to maximize performance.

Why

When talking about time, we often speak with a large amount of implied context. We might say, “I’ll be there tomorrow at 7.” To understand that, we need to interpret this shared understanding of the hidden context. What time zone? Is that in the morning or the afternoon?

To reliably have reproducible behavior, we need to ensure we are communicating the correct context when we work with time in programming. Many libraries tend to either default to what the author is most familiar with and/or leave unimplemented in that context. A common example is the calendar system. It’s often left out-of-date and time libraries due to the complexity. While one may implicitly understand when “March 12th” is, and what month March is, that is only on one calendar (the gregorian calendar), other parts of the world can and often do use other calendar systems.

Ako was written to serve as the date and time library in Rust for as many people, in as many parts of the world as reasonably possible. Ako goes far and above the scope of many libraries across many languages.

Types

explain the difference between Moment, Date, ZonedDateTime

Examples

Get the current date and wall-clock time

use ako::Moment;
use ako::time_zone::Utc;
use ako::calendar::Iso;

// the current moment (the “exact time”),
Moment::now()
    // _on_ the Iso calendar,
    .on(&Iso) //= PlainDateTime
    // _at_ UTC
    .at(&Utc) //= ZonedDateTime
use ako::ZonedDateTime;

// the current date and time, on the ISO-8601 calendar, at UTC
ZonedDateTime::now_iso_utc();

License

Licensed under either of

Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0) MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT) at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.