When running the below test time zone is not consistent:
func TestDateParseOptions(t *testing.T) {
t0, err := dateparse.ParseAny("21/09/2010", dateparse.RetryAmbiguousDateWithSwap(true))
require.NoError(t, err)
t1, err := dateparse.ParseAny("09/21/2010", dateparse.RetryAmbiguousDateWithSwap(true))
require.NoError(t, err)
require.Equal(t, t0, t1)
}
-(time.Time) 2010-09-21 00:00:00 +0200 CEST
+(time.Time) 2010-09-21 00:00:00 +0000 UTC
I guess this is due to this line (below) using time.Local instead of the loc variable. If anyone can guide me if this is somehow intentional or can be changed (I can create a merge request).
|
p, err = parseTime(datestr, time.Local, modifiedOpts...) |
When running the below test time zone is not consistent:
I guess this is due to this line (below) using
time.Localinstead of thelocvariable. If anyone can guide me if this is somehow intentional or can be changed (I can create a merge request).dateparse/parseany.go
Line 253 in 6b43995