Fix improper application of local timezone offset to Unix epochs

This commit is contained in:
NotTheDr01ds 2025-03-10 15:49:40 -04:00
parent 95dcb2fd6c
commit 82ceaa5bab

View File

@ -408,13 +408,10 @@ fn action(input: &Value, args: &Arguments, head: Span) -> Value {
Err(reason) => { Err(reason) => {
match NaiveDateTime::parse_from_str(val, &dt.0) { match NaiveDateTime::parse_from_str(val, &dt.0) {
Ok(d) => { Ok(d) => {
let local_offset = *Local::now().offset();
let dt_fixed = let dt_fixed =
TimeZone::from_local_datetime(&local_offset, &d) Local.from_local_datetime(&d).single().unwrap_or_default();
.single()
.unwrap_or_default();
Value::date (dt_fixed,head) Value::date (dt_fixed.into(),head)
} }
Err(_) => { Err(_) => {
Value::error ( Value::error (