pub struct AmigaDate {
pub days: i32,
pub mins: i32,
pub ticks: i32,
}Expand description
Amiga date representation.
Amiga stores dates as days since January 1, 1978, minutes since midnight, and ticks (1/50 second).
Fields§
§days: i32Days since January 1, 1978.
mins: i32Minutes since midnight.
ticks: i32Ticks (1/50 second).
Implementations§
Source§impl AmigaDate
impl AmigaDate
Sourcepub const fn new(days: i32, mins: i32, ticks: i32) -> Self
pub const fn new(days: i32, mins: i32, ticks: i32) -> Self
Create a new Amiga date from raw values.
Sourcepub fn to_date_time(self) -> DateTime
pub fn to_date_time(self) -> DateTime
Convert to a more usable date format.
Sourcepub const fn to_unix_timestamp(self) -> i64
pub const fn to_unix_timestamp(self) -> i64
Convert to Unix timestamp (seconds since 1970-01-01 00:00:00 UTC).
This matches GRUB’s aftime2ctime() behavior:
days * 86400 + min * 60 + hz / 50 + epoch_offset
The Amiga epoch is January 1, 1978, which is 8 years (2922 days) after the Unix epoch.
Trait Implementations§
impl Copy for AmigaDate
impl Eq for AmigaDate
impl StructuralPartialEq for AmigaDate
Auto Trait Implementations§
impl Freeze for AmigaDate
impl RefUnwindSafe for AmigaDate
impl Send for AmigaDate
impl Sync for AmigaDate
impl Unpin for AmigaDate
impl UnwindSafe for AmigaDate
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more