You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lemmy/crates/utils/src/utils/time.rs

13 lines
257 B
Rust

use chrono::{DateTime, TimeZone, Utc};
pub fn naive_from_unix(time: i64) -> DateTime<Utc> {
Utc
.timestamp_opt(time, 0)
.single()
.expect("convert datetime")
}
pub fn convert_datetime(datetime: DateTime<Utc>) -> DateTime<Utc> {
datetime
}