mirror of
https://github.com/nushell/nushell.git
synced 2025-03-13 06:58:47 +01:00
Fix improper application of local timezone offset to Unix epochs
This commit is contained in:
parent
95dcb2fd6c
commit
82ceaa5bab
@ -408,13 +408,10 @@ fn action(input: &Value, args: &Arguments, head: Span) -> Value {
|
||||
Err(reason) => {
|
||||
match NaiveDateTime::parse_from_str(val, &dt.0) {
|
||||
Ok(d) => {
|
||||
let local_offset = *Local::now().offset();
|
||||
let dt_fixed =
|
||||
TimeZone::from_local_datetime(&local_offset, &d)
|
||||
.single()
|
||||
.unwrap_or_default();
|
||||
Local.from_local_datetime(&d).single().unwrap_or_default();
|
||||
|
||||
Value::date (dt_fixed,head)
|
||||
Value::date (dt_fixed.into(),head)
|
||||
}
|
||||
Err(_) => {
|
||||
Value::error (
|
||||
|
Loading…
Reference in New Issue
Block a user