Debian Codegraph @

t/rt96453.t

raw
1 use Test::More;
2 use_ok( Time::ParseDate );
3
4 $ENV{'TZ'} = 'UTC';
5 is(parsedate('Wed Dec 31 23:59:59 1969', WHOLE => 1),
6 -1, "UTC 1 second before epoch");
7 is(parsedate('Thu Jan 01 00:00:00 1970', WHOLE => 1),
8 0, "UTC epoch second 0");
9 is(parsedate('Thu Jan 01 00:00:01 1970', WHOLE => 1),
10 1, "UTC 1 second after epoch");
11
12 $ENV{'TZ'} = 'MST7MDT';
13 is(parsedate('Wed Dec 31 16:59:59 1969', WHOLE => 1),
14 -1, "MST7MDT 1 second before epoch");
15 is(parsedate('Wed Dec 31 17:00:00 1969', WHOLE => 1),
16 0, "MST7MDT epoch second 0");
17 is(parsedate('Wed Dec 31 17:00:01 1969', WHOLE => 1),
18 1, "MST7MDT 1 second after epoch");
19
20
21 done_testing();