mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-05-20 02:38:05 +00:00
514f2222e0
* convert naive time to utc time * compounding fixes * cargo fmt * fix the rest * fix down migration * fix migrations * fix after merge * clippy fix * ap-fed 0.5.0 --------- Co-authored-by: Nutomic <me@nutomic.com>
13 lines
257 B
Rust
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
|
|
}
|