mirror of
https://github.com/araddon/dateparse.git
synced 2026-02-02 18:07:51 +00:00
support yyyddmm integer values as date
This commit is contained in:
@@ -43,6 +43,8 @@ import (
|
||||
10/13/2014
|
||||
01/02/2006
|
||||
|
||||
20140601
|
||||
|
||||
2016-03-14 00:00:00.000
|
||||
2006-01-02
|
||||
2014-05-11 08:20:13,787 // i couldn't find parser for this in go?
|
||||
@@ -255,6 +257,12 @@ func TestParse(t *testing.T) {
|
||||
//u.Debug(ts.In(time.UTC).Unix(), ts.In(time.UTC))
|
||||
assert.T(t, "2014-05-11 08:20:13.787 +0000 UTC" == fmt.Sprintf("%v", ts.In(time.UTC)))
|
||||
|
||||
// yyyy mm dd
|
||||
ts, err = ParseAny("20140601")
|
||||
assert.Tf(t, err == nil, "%v", err)
|
||||
//u.Debug(ts.In(time.UTC).Unix(), ts.In(time.UTC))
|
||||
assert.T(t, "2014-06-01 00:00:00 +0000 UTC" == fmt.Sprintf("%v", ts.In(time.UTC)))
|
||||
|
||||
ts, err = ParseAny("1332151919")
|
||||
assert.Tf(t, err == nil, "%v", err)
|
||||
//u.Debug(ts.In(time.UTC).Unix(), ts.In(time.UTC))
|
||||
|
||||
Reference in New Issue
Block a user