2
0
mirror of https://github.com/araddon/dateparse.git synced 2026-07-04 16:56:16 +08:00

parse unix

This commit is contained in:
Aaron Raddon
2014-04-25 16:59:10 -07:00
parent 99b6954ef6
commit bb9e1dcbca
2 changed files with 23 additions and 0 deletions

View File

@@ -59,11 +59,18 @@ func TestParse(t *testing.T) {
//u.Debugf("%v", f)
//u.Debugf("%v", ts)
assert.T(t, ts.In(time.UTC).Unix() == 1241805471)
ts, err = ParseAny("03/19/2012 10:11:59")
assert.T(t, err == nil)
//u.Debug(ts.Unix(), ts)
assert.T(t, ts.Unix() == 1332151919)
// Unix Time Stamp
ts, err = ParseAny("1332151919")
assert.T(t, err == nil)
u.Debug(ts.Unix(), ts)
assert.T(t, ts.Unix() == 1332151919)
ts2, err := ParseAny("2009-08-12T22:15:09-07:00")
assert.T(t, err == nil)
//u.Debug(ts2.In(time.UTC), " ", ts2.Unix())