line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Time::Strptime::TimeZone; |
2
|
4
|
|
|
4
|
|
27
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
118
|
|
3
|
4
|
|
|
4
|
|
20
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
97
|
|
4
|
4
|
|
|
4
|
|
19
|
use utf8; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
30
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
1955
|
use DateTime::TimeZone; |
|
4
|
|
|
|
|
137043
|
|
|
4
|
|
|
|
|
142
|
|
7
|
4
|
|
|
4
|
|
33
|
use Scalar::Util qw/blessed/; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
218
|
|
8
|
|
|
|
|
|
|
|
9
|
4
|
|
|
4
|
|
36
|
use constant UNIX_EPOCH => 62135683200; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
952
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $DEFAULT = 'local'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
27
|
|
|
27
|
0
|
51
|
my ($class, $name) = @_; |
15
|
27
|
|
66
|
|
|
62
|
$name ||= $DEFAULT; |
16
|
27
|
50
|
33
|
|
|
137
|
my $tz = blessed $name && $name->isa('DateTime::TimeZone') ? $name : DateTime::TimeZone->new(name => $name); |
17
|
27
|
|
|
|
|
1815
|
return bless [$tz, 0] => $class; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
40
|
|
|
40
|
0
|
102
|
sub name { $_[0]->[0]->name } |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
0
|
0
|
0
|
sub local_rd_as_seconds { $_[0]->[1] + UNIX_EPOCH } |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
1
|
0
|
5
|
sub set_timezone { $_[0]->[0] = DateTime::TimeZone->new(name => $_[1]) } |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub offset { |
27
|
1
|
|
|
1
|
0
|
3
|
$_[0]->[1] = $_[1]; |
28
|
1
|
|
|
|
|
4
|
$_[0]->[0]->offset_for_local_datetime($_[0]); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
__END__ |