pub struct DateTime {
    pub year: u16,
    pub month: u8,
    pub day: u8,
    pub hour: u8,
    pub minute: u8,
    pub second: u8,
    pub nanosecond: Option<u32>,
    pub offset: Option<i16>,
}
Expand description

A struct used to parse a DateTime field.

Examples

use exif::DateTime;
let dt = DateTime::from_ascii(b"2016:05:04 03:02:01")?;
assert_eq!(dt.year, 2016);
assert_eq!(dt.to_string(), "2016-05-04 03:02:01");

Fields

year: u16month: u8day: u8hour: u8minute: u8second: u8nanosecond: Option<u32>

The subsecond data in nanoseconds. If the Exif attribute has more sigfinicant digits, they are rounded down.

offset: Option<i16>

The offset of the time zone in minutes.

Implementations

Parse an ASCII data of a DateTime field. The range of a number is not validated, so, for example, 13 may be returned as the month.

If the value is blank, Error::BlankValue is returned.

Parses an SubsecTime-like field.

Parses an OffsetTime-like field.

Trait Implementations

Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.