mirror of
https://github.com/nushell/nushell.git
synced 2025-03-13 15:08:43 +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) => {
|
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 (
|
||||||
|
Loading…
Reference in New Issue
Block a user