[−][src]Function epochs::to_unix
pub fn to_unix(ndt: NaiveDateTime) -> i64
Convert the given NaiveDateTime to a Unix time.
use chrono::NaiveDateTime; use epochs::to_unix; let ndt = NaiveDateTime::parse_from_str("2009-02-13 23:31:30", "%Y-%m-%d %H:%M:%S").unwrap(); assert_eq!(to_unix(ndt), 1234567890);