Struct palmrs_database::time::PalmTimestamp
source · #[repr(C, packed)]pub struct PalmTimestamp(pub u32);
Expand description
Type representing a Palm OS timestamp
The raw data contained within this struct can be either of the Palm OS timestamp formats (seconds since the UNIX epoch, or seconds since the “old Palm epoch,” see the module documentation for more info), so that this type can be embedded directly within raw data structures.
To get a usable timestamp from this type, the as_unix_ts
method
can be called to return the number of seconds since the Unix epoch.
Tuple Fields§
§0: u32
Implementations§
source§impl PalmTimestamp
impl PalmTimestamp
sourcepub fn as_unix_ts(&self) -> i32
pub fn as_unix_ts(&self) -> i32
Return the timestamp as the seconds since the UNIX epoch
If the containing type contains an “old Palm epoch” timestamp, as may be the case if the timestamp was loaded from a PRC/PDB file, this method will perform an implicit conversion to the UNIX epoch.
sourcepub fn strftime(&self, format: &str) -> String
pub fn strftime(&self, format: &str) -> String
Return the timestamp as a strftime
-formatted string
This uses the formatting specifiers from chrono::format::strftime
.
Trait Implementations§
source§impl Clone for PalmTimestamp
impl Clone for PalmTimestamp
source§fn clone(&self) -> PalmTimestamp
fn clone(&self) -> PalmTimestamp
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PalmTimestamp
impl Debug for PalmTimestamp
source§impl Default for PalmTimestamp
impl Default for PalmTimestamp
source§impl Display for PalmTimestamp
impl Display for PalmTimestamp
source§impl PartialEq<PalmTimestamp> for PalmTimestamp
impl PartialEq<PalmTimestamp> for PalmTimestamp
source§fn eq(&self, other: &PalmTimestamp) -> bool
fn eq(&self, other: &PalmTimestamp) -> bool
self
and other
values to be equal, and is used
by ==
.