[][src]Function built::util::strptime

pub fn strptime(s: &str) -> DateTime<Utc>

Parse a time-string as formatted by built.

extern crate built;
extern crate chrono;
use chrono::Datelike;

pub mod build_info {
    pub const BUILT_TIME_UTC: &'static str = "Tue, 14 Feb 2017 05:21:41 GMT";
}

assert_eq!(built::util::strptime(&build_info::BUILT_TIME_UTC).year(), 2017);

Panics

If the string can't be parsed. This should never happen with input provided by built.