2
0
mirror of https://github.com/araddon/dateparse.git synced 2026-02-01 02:44:59 +00:00

Support Chinese Date Format

This commit is contained in:
Aaron Raddon
2017-11-18 11:07:33 -08:00
parent 27c51625d4
commit f30ca3179c
4 changed files with 44 additions and 7 deletions

View File

@@ -14,7 +14,7 @@ import (
// !!!!! The time-zone of local machine effects the results!
// https://play.golang.org/p/IDHRalIyXh
// https://github.com/golang/go/issues/18012
func TestParseInLocation(t *testing.T) {
func TestInLocation(t *testing.T) {
denverLoc, err := time.LoadLocation("America/Denver")
assert.Equal(t, nil, err)
@@ -180,6 +180,15 @@ func TestParse(t *testing.T) {
ts = MustParse("2013-Feb-03")
assert.Equal(t, "2013-02-03 00:00:00 +0000 UTC", fmt.Sprintf("%v", ts.In(time.UTC)))
//---------------------------------------------
// Chinese 2014年04月18日
ts = MustParse("2014年04月08日")
assert.Equal(t, "2014-04-08 00:00:00 +0000 UTC", fmt.Sprintf("%v", ts.In(time.UTC)))
ts = MustParse("2014年04月08日 19:17:22")
assert.Equal(t, "2014-04-08 19:17:22 +0000 UTC", fmt.Sprintf("%v", ts.In(time.UTC)))
//---------------------------------------------
// mm/dd/yyyy ?