CHANGED TIMEZONE FORMATTING
This commit is contained in:
parent
3be39df282
commit
cf85c60c1c
1 changed files with 2 additions and 3 deletions
|
@ -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))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue