mirror of
https://github.com/araddon/dateparse.git
synced 2026-07-04 16:56:16 +08:00
parse unix
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user