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.