[][src]Trait fastobo::ast::DateTime

pub trait DateTime {
    fn to_xsd_datetime(&self) -> String;
}

A trait for common operations on OBO datetimes.

Required methods

fn to_xsd_datetime(&self) -> String

Generate an XML Schema datetime serialization of the DateTime.

Example

let dt = NaiveDateTime::new(8, 5, 2019, 13, 2);
assert_eq!(dt.to_xsd_datetime(), "2019-05-08T13:02:00");
Loading content...

Implementors

impl DateTime for IsoDateTime[src]

fn to_xsd_datetime(&self) -> String[src]

Generate an XML Schema datetime serialization of the IsoDateTime.

impl DateTime for NaiveDateTime[src]

fn to_xsd_datetime(&self) -> String[src]

Generate an XML Schema datetime serialization of the NaiveDateTime.

Note

While NaiveDateTime structs do not store seconds, the xsd:dateTime format requires all components to be present in the serialization, so the date is initialized with seconds set to 0.

Loading content...