pub struct FileTime { /* private fields */ }Expand description
FILETIME type
Used by Microsoft software to describe file creation/access timestamps In contrary to unix, the FILETIME-Epoch is: 1601-01-01T00:00:00.000000000Z
Allows conversion between:
- Raw i64 value
- DateTime UTC
Implementations§
Source§impl FileTime
impl FileTime
Sourcepub fn new(secs: i64, nsecs: i64) -> Self
pub fn new(secs: i64, nsecs: i64) -> Self
Construct new FileTime by providing seconds and nanoseconds since 1601-01-01T00:00:00.000000000Z
Sourcepub fn nanoseconds(&self) -> i64
pub fn nanoseconds(&self) -> i64
Leap Nanoseconds since FILETIME-Epoch
Sourcepub fn filetime(&self) -> i64
pub fn filetime(&self) -> i64
Return FILETIME as i64
use filetime_type::FileTime;
let ft_i64 = FileTime::now().filetime();Sourcepub fn filetime_epoch() -> DateTime<Utc>
pub fn filetime_epoch() -> DateTime<Utc>
Return FILETIME epoch as DateTime
Sourcepub fn from_i64(filetime: i64) -> Self
pub fn from_i64(filetime: i64) -> Self
Example
use filetime_type::FileTime;
// 2009-07-25T23:00:00.000001000Z
let ft = FileTime::from_i64(128930364000001000);Sourcepub fn from_datetime(dt: DateTime<Utc>) -> Self
pub fn from_datetime(dt: DateTime<Utc>) -> Self
Example
use chrono::Utc;
use filetime_type::FileTime;
let ft = FileTime::from_datetime(Utc::now());Sourcepub fn to_datetime(&self) -> DateTime<Utc>
pub fn to_datetime(&self) -> DateTime<Utc>
Example
use chrono::{DateTime, Utc};
use filetime_type::FileTime;
let ft_now: DateTime<Utc> = FileTime::now().to_datetime();Trait Implementations§
impl Copy for FileTime
impl Eq for FileTime
impl StructuralPartialEq for FileTime
Auto Trait Implementations§
impl Freeze for FileTime
impl RefUnwindSafe for FileTime
impl Send for FileTime
impl Sync for FileTime
impl Unpin for FileTime
impl UnwindSafe for FileTime
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