Skip to content

Commit

Permalink
Fix date parse for "2016-03-06 15:28:01 +0900"
Browse files Browse the repository at this point in the history
  • Loading branch information
tuziemon authored Aug 15, 2021
1 parent 3f42935 commit 8807572
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cast_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,8 @@ func TestToTime(t *testing.T) {
{"2016-03-06 15:28:01", time.Date(2016, 3, 6, 15, 28, 1, 0, time.UTC), false},
{"2016-03-06 15:28:01 -0000", time.Date(2016, 3, 6, 15, 28, 1, 0, time.UTC), false},
{"2016-03-06 15:28:01 -00:00", time.Date(2016, 3, 6, 15, 28, 1, 0, time.UTC), false},
{"2016-03-06 15:28:01 +0900", time.Date(2016, 3, 6, 6, 28, 1, 0, time.UTC), false},
{"2016-03-06 15:28:01 +09:00", time.Date(2016, 3, 6, 6, 28, 1, 0, time.UTC), false},
{"2006-01-02", time.Date(2006, 1, 2, 0, 0, 0, 0, time.UTC), false},
{"02 Jan 2006", time.Date(2006, 1, 2, 0, 0, 0, 0, time.UTC), false},
{1472574600, time.Date(2016, 8, 30, 16, 30, 0, 0, time.UTC), false},
Expand Down
4 changes: 2 additions & 2 deletions caste.go
Original file line number Diff line number Diff line change
Expand Up @@ -1296,8 +1296,8 @@ var (
timeFormat{"2006-01-02 15:04:05Z07:00", timeFormatNumericTimezone},
timeFormat{"2006-01-02", timeFormatNoTimezone},
timeFormat{"02 Jan 2006", timeFormatNoTimezone},
timeFormat{"2006-01-02 15:04:05 -07:00", 1},
timeFormat{"2006-01-02 15:04:05 -0700", 1},
timeFormat{"2006-01-02 15:04:05 -07:00", timeFormatNumericTimezone},
timeFormat{"2006-01-02 15:04:05 -0700", timeFormatNumericTimezone},
timeFormat{time.Kitchen, timeFormatTimeOnly},
timeFormat{time.Stamp, timeFormatTimeOnly},
timeFormat{time.StampMilli, timeFormatTimeOnly},
Expand Down

0 comments on commit 8807572

Please sign in to comment.