CHANGED TIMEZONE FORMATTING

This commit is contained in:
heavyweaponsgal 2024-05-03 00:24:18 +02:00
parent 3be39df282
commit cf85c60c1c

View file

@ -4,10 +4,9 @@ use chrono::{DateTime, TimeZone};
use crate::post::PostMetadata; use crate::post::PostMetadata;
pub fn date<T: TimeZone>(date: &DateTime<T>) -> Result<String, askama::Error> { pub fn date<Utc: TimeZone>(date: &DateTime<Utc>) -> Result<String, askama::Error> {
Ok(date.to_rfc3339_opts(chrono::SecondsFormat::Secs, true)) Ok(date.to_utc().format("%Y-%m-%d %H:%M:%S UTC").to_string())
} }
pub fn duration(duration: &&Duration) -> Result<String, askama::Error> { pub fn duration(duration: &&Duration) -> Result<String, askama::Error> {
Ok(format!("{:?}", duration)) Ok(format!("{:?}", duration))
} }