2
0
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:
Aaron Raddon
2015-08-18 15:50:04 -07:00
parent ed500d214a
commit b93aaa0470
2 changed files with 19 additions and 0 deletions

View File

@@ -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))