Skip to content

v0.5.0

Latest
Compare
Choose a tag to compare
@GiyoMoon GiyoMoon released this 08 Oct 18:58
· 5 commits to main since this release
v0.5.0
663ab6e

Astrolabe can now get the local timezone offset on UNIX systems.

use astrolabe::{DateTime, Offset, OffsetUtilities, Precision};

// Equivalent to `DateTime::now().set_offset(Offset::Local)`
let now = DateTime::now_local();
// Prints for example:
// 2023-10-08T08:30:00+02:00
println!("{}", now.format_rfc3339(Precision::Seconds));
assert_eq!(Offset::Local, now.get_offset());

Also, we decided to panic in case of a date overflow. This should not happen if the library is used correctly, as the valid date range is between 30. June -5879611..=12. July 5879611. This change makes the API much easier to use, as many functions only returned a Result because of this edge case.

Please check out the changelog for details.