line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Google::Code::DateTime; |
2
|
9
|
|
|
9
|
|
1120
|
use Any::Moose; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
74
|
|
3
|
|
|
|
|
|
|
extends 'DateTime'; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our %MONMAP = ( |
6
|
|
|
|
|
|
|
Jan => 1, |
7
|
|
|
|
|
|
|
Feb => 2, |
8
|
|
|
|
|
|
|
Mar => 3, |
9
|
|
|
|
|
|
|
Apr => 4, |
10
|
|
|
|
|
|
|
May => 5, |
11
|
|
|
|
|
|
|
Jun => 6, |
12
|
|
|
|
|
|
|
Jul => 7, |
13
|
|
|
|
|
|
|
Aug => 8, |
14
|
|
|
|
|
|
|
Sep => 9, |
15
|
|
|
|
|
|
|
Oct => 10, |
16
|
|
|
|
|
|
|
Nov => 11, |
17
|
|
|
|
|
|
|
Dec => 12, |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub new_from_string { |
21
|
54
|
|
|
54
|
1
|
780
|
my $class = shift; |
22
|
54
|
|
|
|
|
80
|
my $base_date = shift; |
23
|
54
|
100
|
|
|
|
420
|
if ( |
|
|
50
|
|
|
|
|
|
24
|
|
|
|
|
|
|
$base_date =~ /\w{3}\s+(\w+)\s+(\d+)\s+(\d\d):(\d\d):(\d\d)\s+(\d{4})/ ) |
25
|
|
|
|
|
|
|
{ |
26
|
|
|
|
|
|
|
# Tue Jan 6 19:17:39 2009 |
27
|
10
|
|
|
|
|
32
|
my $mon = $1; |
28
|
10
|
|
|
|
|
25
|
my $dom = $2; |
29
|
10
|
|
|
|
|
28
|
my $h = $3; |
30
|
10
|
|
|
|
|
22
|
my $m = $4; |
31
|
10
|
|
|
|
|
21
|
my $s = $5; |
32
|
10
|
|
|
|
|
20
|
my $y = $6; |
33
|
10
|
|
|
|
|
94
|
my $date = $class->new( |
34
|
|
|
|
|
|
|
year => $y, |
35
|
|
|
|
|
|
|
month => $MONMAP{$mon}, |
36
|
|
|
|
|
|
|
day => $dom, |
37
|
|
|
|
|
|
|
hour => $h, |
38
|
|
|
|
|
|
|
minute => $m, |
39
|
|
|
|
|
|
|
second => $s, |
40
|
|
|
|
|
|
|
time_zone => 'US/Pacific', # google's time zone |
41
|
|
|
|
|
|
|
); |
42
|
10
|
|
|
|
|
75944
|
$date->set_time_zone( 'UTC' ); |
43
|
10
|
|
|
|
|
2050
|
return $date; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
elsif ( $base_date =~ /(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z/ ) |
46
|
|
|
|
|
|
|
{ |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# 2009-06-01T13:00:10Z |
49
|
44
|
|
|
|
|
185
|
return $class->new( |
50
|
|
|
|
|
|
|
year => $1, |
51
|
|
|
|
|
|
|
month => $2, |
52
|
|
|
|
|
|
|
day => $3, |
53
|
|
|
|
|
|
|
hour => $4, |
54
|
|
|
|
|
|
|
minute => $5, |
55
|
|
|
|
|
|
|
second => $6, |
56
|
|
|
|
|
|
|
time_zone => 'UTC', |
57
|
|
|
|
|
|
|
); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
9
|
|
|
9
|
|
7403
|
no Any::Moose; |
|
9
|
|
|
|
|
30
|
|
|
9
|
|
|
|
|
49
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
__END__ |