mirror of
https://github.com/modrinth/code.git
synced 2026-07-31 21:26:40 +00:00
More flexible datetime parsing (#4533)
This commit is contained in:
@@ -34,7 +34,7 @@ where
|
||||
|
||||
serde_json::from_str::<DateTime<Utc>>(&format!("\"{s}\""))
|
||||
.or_else(|_| {
|
||||
NaiveDateTime::parse_from_str(&s, "%Y-%m-%dT%H:%M:%S%.9f")
|
||||
NaiveDateTime::parse_from_str(&s, "%Y-%m-%dT%H:%M:%S%.f")
|
||||
.map(|date| date.and_utc())
|
||||
})
|
||||
.map_err(serde::de::Error::custom)
|
||||
|
||||
Reference in New Issue
Block a user