Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #| Run internal tests
- multi sub MAIN('test') {
- use Test;
- plan 4;
- is-deeply from-timestamp(1450915200), Date.new('2015-12-24'),
- 'Timestamp to Date';;
- my $dt = from-timestamp(1450915201);
- is $dt, "2015-12-24 00:00:01",
- 'Timestamp to DateTime with string formatting';
- is from-date-string('2015-12-24').posix, 1450915200,
- 'from-date-string, one argument';
- is from-date-string('2015-12-24', '00:00:01').posix, 1450915201,
- 'from-date-string, two arguments';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement