Skip to content

Commit

Permalink
Remove implicit date's timezone set on parse
Browse files Browse the repository at this point in the history
  • Loading branch information
antonmedv committed May 8, 2024
1 parent bd688c3 commit 83d67e7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion builtin/builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,6 @@ var Builtins = []*Function{
if err != nil {
return nil, err
}
t = t.In(tz)
return t, nil
}

Expand Down
2 changes: 1 addition & 1 deletion builtin/builtin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func TestBuiltin(t *testing.T) {
{`duration("1h")`, time.Hour},
{`date("2006-01-02T15:04:05Z")`, time.Date(2006, 1, 2, 15, 4, 5, 0, time.UTC)},
{`date("2006.01.02", "2006.01.02")`, time.Date(2006, 1, 2, 0, 0, 0, 0, time.UTC)},
{`date("2023-04-23T00:30:00.000+0100", "2006-01-02T15:04:05-0700", "America/Chicago").Format("2006-01-02")`, "2023-04-22"},
{`date("2023-04-23T00:30:00.000+0100", "2006-01-02T15:04:05-0700", "America/Chicago").Format("2006-01-02")`, "2023-04-23"},
{`date("2023-04-23T00:30:00", "2006-01-02T15:04:05", "America/Chicago").Format("2006-01-02")`, "2023-04-23"},
{`date("2023-04-23", "2006-01-02", "America/Chicago").Format("2006-01-02")`, "2023-04-23"},
{`timezone("UTC").String()`, "UTC"},
Expand Down

0 comments on commit 83d67e7

Please sign in to comment.