diff options
author | Nathan Gass | 2011-10-28 13:03:45 +0000 |
---|---|---|
committer | Nathan Gass | 2011-10-28 13:03:45 +0000 |
commit | b3b1362596fd721f0bedcf266bb39948ca1831c8 (patch) | |
tree | 0209151461373c2e8762558009e7da5c448dd615 /tests | |
parent | 1c514b000af332b3385b99f93af5132fcfe5a6f8 (diff) | |
download | itools-b3b1362596fd721f0bedcf266bb39948ca1831c8.tar.gz itools-b3b1362596fd721f0bedcf266bb39948ca1831c8.tar.bz2 itools-b3b1362596fd721f0bedcf266bb39948ca1831c8.zip |
some more date tests
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/it.t | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -223,10 +223,14 @@ is(it::date('date', '2011-10-25 + 3 days'), '28.10.2011', 'some date arithmetic' is(it::date('datetime', time()), it::date('datetime'), 'recognize int as timestamp'); is(it::date('datetime', time()*1.0), it::date('datetime'), 'recognize float as timestamp'); is(it::date('datetime', time() . ''), it::date('datetime'), 'recognize digit string as timestamp'); +is(it::date('datetime', '@' . time()), it::date('datetime'), 'recognize strtotime timestamp format'); is(it::date('datetime', 10), it::date('datetime', "10"), 'numeric and string give same result'); +is(it::date('datetime', 10.0), it::date('datetime', "10"), '... as long as num is properly truncated'); is(it::date('datetime', 10.5), it::date('datetime', "10.5"), '... with one digit after point'); is(it::date('datetime', 10.56), it::date('datetime', "10.56"), '... with two digits after point'); is(it::date('datetime', 1000000), it::date('datetime', "1000000"), '... large nummer'); is(it::date('datetime', 1000000.543), it::date('datetime', "1000000.543"), '... large nummer and point'); +is(it::date('time', 10.5), "10:05", 'interpret floating points with strtotime'); +is(it::date('time', 10.05), "10:05", 'interpret floating points with strtotime'); ?> |