Initial commit

This commit is contained in:
Aleksandr 2025-06-22 05:46:26 +03:00
commit 75a589f235
43 changed files with 4840 additions and 0 deletions

23
src/time/tz.rs Normal file
View file

@ -0,0 +1,23 @@
//! # Timezones
//!
//! Timezone utilities.
use crate::{data, time::Hours};
#[data(ord, copy, crate = crate)]
pub struct FixedOffset(Hours);
impl FixedOffset {
/// UTC time offset. Basically no offset.
pub const UTC: Self = Self(Hours::new(0).unwrap());
/// Make offset from hours.
pub const fn from_hours(hours: Hours) -> Self {
Self(hours)
}
/// Get offset in hours.
pub const fn hours(self) -> Hours {
self.0
}
}