pub struct WinFiletime(pub u64);Expand description
Simplifies handling Windows filetime dates. Use only with UTC dates as it does not take time zones into account. Eliminates the need to use the chrono library.
use forensic_rs::prelude::*;
assert_eq!("01-01-1601 00:00:00", format!("{:?}", WinFiletime(0)));
assert_eq!("01-01-1605 00:00:00", format!("{:?}", WinFiletime(1262304000000000)));
assert_eq!("14-11-1999 18:27:59", format!("{:?}", WinFiletime(125870776790000000)));
assert_eq!("14-11-2000 18:27:59.001", format!("{:?}", WinFiletime(126187000790010000)));Tuple Fields§
§0: u64Implementations§
Source§impl WinFiletime
impl WinFiletime
pub fn new() -> Self
Sourcepub fn year(&self) -> u32
pub fn year(&self) -> u32
Returns the year number
use forensic_rs::prelude::*;
let time = WinFiletime(125963224790010000); // 29-02-2000 18:27:59.001
assert_eq!(2000, time.year());Sourcepub fn month(&self) -> u32
pub fn month(&self) -> u32
Returns the month number starting from 1
use forensic_rs::prelude::*;
let time = WinFiletime(125963224790010000); // 29-02-2000 18:27:59.001
assert_eq!(2, time.month());Sourcepub fn day(&self) -> u32
pub fn day(&self) -> u32
Returns the day of month starting from 1
use forensic_rs::prelude::*;
let time = WinFiletime(125963224790010000); // 29-02-2000 18:27:59.001
assert_eq!(29, time.day());Sourcepub fn hour(&self) -> u32
pub fn hour(&self) -> u32
Returns the hour number from 0 to 23.
use forensic_rs::prelude::*;
let time = WinFiletime(125963224790010000); // 29-02-2000 18:27:59.001
assert_eq!(18, time.hour());Sourcepub fn minute(&self) -> u32
pub fn minute(&self) -> u32
Returns the minute number from 0 to 59.
use forensic_rs::prelude::*;
let time = WinFiletime(125963224790010000); // 29-02-2000 18:27:59.001
assert_eq!(27, time.minute());Sourcepub fn second(&self) -> u32
pub fn second(&self) -> u32
Returns the second number from 0 to 59.
use forensic_rs::prelude::*;
let time = WinFiletime(125963224790010000); // 29-02-2000 18:27:59.001
assert_eq!(59, time.second());Sourcepub fn milliseconds(&self) -> u32
pub fn milliseconds(&self) -> u32
Obtain the millisecond part
use forensic_rs::prelude::*;
let time = WinFiletime(125963224790010000); // 29-02-2000 18:27:59.001
assert_eq!(1, time.milliseconds());Trait Implementations§
Source§impl Clone for WinFiletime
impl Clone for WinFiletime
Source§fn clone(&self) -> WinFiletime
fn clone(&self) -> WinFiletime
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WinFiletime
impl Debug for WinFiletime
Source§impl Default for WinFiletime
impl Default for WinFiletime
Source§fn default() -> WinFiletime
fn default() -> WinFiletime
Returns the “default value” for a type. Read more
Source§impl From<&WinFiletime> for SystemTime
impl From<&WinFiletime> for SystemTime
Source§fn from(val: &WinFiletime) -> Self
fn from(val: &WinFiletime) -> Self
Converts to this type from the input type.
Source§impl From<WinFiletime> for SystemTime
impl From<WinFiletime> for SystemTime
Source§fn from(val: WinFiletime) -> Self
fn from(val: WinFiletime) -> Self
Converts to this type from the input type.
Source§impl From<u64> for WinFiletime
impl From<u64> for WinFiletime
impl Copy for WinFiletime
Auto Trait Implementations§
impl Freeze for WinFiletime
impl RefUnwindSafe for WinFiletime
impl Send for WinFiletime
impl Sync for WinFiletime
impl Unpin for WinFiletime
impl UnwindSafe for WinFiletime
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