nextsync-rust/src/utils/time.rs
2023-06-17 16:41:00 +02:00

6 lines
222 B
Rust

use chrono::{DateTime, TimeZone, Utc, ParseError};
pub fn parse_timestamp(timestamp: &str) -> Result<DateTime<Utc>, ParseError> {
let format = "%a, %d %b %Y %H:%M:%S %Z";
Utc.datetime_from_str(timestamp, format)
}