Trait edtf::GetTimezone[][src]

pub trait GetTimezone {
    fn tz_offset(&self) -> TzOffset;
}
Expand description

A helper trait for getting timezone information from some value. (Especially chrono::DateTime or chrono::NaiveDateTime.)

Implementations for the chrono types are included with feature = ["chrono"].

Not implemented on DateTime because this is only used as a bound on impl<T> From<T> for DateTime implementations.

Required methods

Return the number of seconds difference from UTC.

  • TzOffset::None represents NO timezone information on the EDTF timestamp.
  • TzOffset::Utc represents a Z timezone, i.e. UTC/Zulu time.
  • TzOffset::Hours(1) represents `+01
  • TzOffset::Minutes(-16_200) represents -04:30

Implementations on Foreign Types

This implementation maps to an EDTF timestamp without any timezone information attached.

This implementation maps to an EDTF timestamp with a Z on the end.

This implementation maps to an EDTF timestamp with a timezone offset like +04:00.

This implementation maps to an EDTF timestamp with a timezone offset like +04:00.

Implementors