monotonic_time/
datetime_formats.rs

1use core::fmt;
2
3/// Date and time formats currently supports `UTC` and `TAI`
4#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]
5pub enum DateTimeFormat {
6    /// The `Coordinated Universal Time` time format
7    Utc,
8    /// The ` Temps Atomique International` time format
9    Tai,
10}
11
12impl Default for DateTimeFormat {
13    fn default() -> Self {
14        DateTimeFormat::Utc
15    }
16}
17impl fmt::Display for DateTimeFormat {
18    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
19        write!(
20            f,
21            "{}",
22            match self {
23                Self::Utc => "UTC",
24                Self::Tai => "TAI",
25            }
26        )
27    }
28}