Type Alias ION_TIMESTAMP

Source
pub type ION_TIMESTAMP = _ion_timestamp;
Expand description

Structure to store time information. time_t only has up to second precision, and time zone support is OS dependent. _ion_timestamp uses decimal to store fraction of a second

Aliased Type§

struct ION_TIMESTAMP {
    pub precision: u8,
    pub tz_offset: i16,
    pub year: u16,
    pub month: u16,
    pub day: u16,
    pub hours: u16,
    pub minutes: u16,
    pub seconds: u16,
    pub fraction: decQuad,
}

Fields§

§precision: u8

Defined as ION_TS_YEAR, ION_TS_MONTH, ION_TS_DAY, ION_TS_MIN, ION_TS_SEC, ION_TS_FRAC

§tz_offset: i16

Time zone offset (+/- 24 hours), in term of minutes.

§year: u16§month: u16§day: u16§hours: u16§minutes: u16§seconds: u16§fraction: decQuad

Fraction of a second, e.g: 0.5, 0.01, etc

Implementations§

Source§

impl ION_TIMESTAMP

Source

pub fn try_assign_from_iondt(&mut self, ion_dt: &IonDateTime) -> IonCResult<()>

Converts the given IonDateTime into this ION_TIMESTAMP.

Source

pub fn try_to_iondt(&mut self) -> IonCResult<IonDateTime>

Converts this ION_TIMESTAMP into a IonDateTime.

Note that this borrows mutably, because all of the underlying ion_timestamp_* functions require a mutable pointer, but this operation does not actually change the value.