File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ func Parse(input string) (time.Time, error) {
52
52
}
53
53
54
54
unixSeconds := int64 (daysSinceEpoch (year , month , day ))* 86400 + int64 (hour * 3600 + minute * 60 + second )
55
- return time .Unix (unixSeconds , 0 ), nil
55
+ return time .Unix (unixSeconds , 0 ). UTC () , nil
56
56
57
57
case 24 : // YYYY-MM-DDTHH:MM:SS.MMMZ
58
58
t1 := binary .LittleEndian .Uint64 (b )
@@ -89,7 +89,7 @@ func Parse(input string) (time.Time, error) {
89
89
}
90
90
91
91
unixSeconds := int64 (daysSinceEpoch (year , month , day ))* 86400 + int64 (hour * 3600 + minute * 60 + second )
92
- return time .Unix (unixSeconds , int64 (millis * 1e6 )), nil
92
+ return time .Unix (unixSeconds , int64 (millis * 1e6 )). UTC () , nil
93
93
94
94
default :
95
95
return time .Parse (time .RFC3339Nano , input )
Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ func TestParse(t *testing.T) {
42
42
t .Error (err )
43
43
} else if ! actual .Equal (expect ) {
44
44
t .Errorf ("unexpected time: %v vs expected %v" , actual , expect )
45
+ } else if actual .Location ().String () != expect .Location ().String () {
46
+ t .Errorf ("unexpected timezone: %v vs expected %v" , actual .Location ().String (), expect .Location ().String ())
45
47
}
46
48
})
47
49
}
You can’t perform that action at this time.
0 commit comments