Struct exif::DateTime [−][src]
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>, }
A struct used to parse a DateTime field.
Examples
use exif::DateTime; let dt = DateTime::from_ascii(b"2016:05:04 03:02:01").unwrap(); assert_eq!(dt.year, 2016); assert_eq!(format!("{}", dt), "2016-05-04 03:02:01");
Fields
year: u16
month: u8
day: u8
hour: u8
minute: u8
second: u8
nanosecond: 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.
Methods
impl DateTime
[src]
impl DateTime
pub fn from_ascii(data: &[u8]) -> Result<DateTime, Error>
[src]
pub fn from_ascii(data: &[u8]) -> Result<DateTime, Error>
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.
pub fn parse_subsec(&mut self, data: &[u8]) -> Result<(), Error>
[src]
pub fn parse_subsec(&mut self, data: &[u8]) -> Result<(), Error>
Parses an SubsecTime-like field.
pub fn parse_offset(&mut self, data: &[u8]) -> Result<(), Error>
[src]
pub fn parse_offset(&mut self, data: &[u8]) -> Result<(), Error>
Parses an OffsetTime-like field.
Trait Implementations
impl Debug for DateTime
[src]
impl Debug for DateTime
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Display for DateTime
[src]
impl Display for DateTime