line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SOAP::WSDL::XSD::Typelib::Builtin::dateTime; |
2
|
38
|
|
|
38
|
|
1002
|
use strict; |
|
38
|
|
|
|
|
79
|
|
|
38
|
|
|
|
|
1412
|
|
3
|
38
|
|
|
38
|
|
206
|
use warnings; |
|
38
|
|
|
|
|
77
|
|
|
38
|
|
|
|
|
1240
|
|
4
|
38
|
|
|
38
|
|
231
|
use Date::Parse; |
|
38
|
|
|
|
|
80
|
|
|
38
|
|
|
|
|
4823
|
|
5
|
38
|
|
|
38
|
|
213
|
use Date::Format; |
|
38
|
|
|
|
|
88
|
|
|
38
|
|
|
|
|
3033
|
|
6
|
|
|
|
|
|
|
|
7
|
38
|
|
|
38
|
|
960
|
use Class::Std::Fast::Storable constructor => 'none', cache => 1; |
|
38
|
|
|
|
|
27970
|
|
|
38
|
|
|
|
|
337
|
|
8
|
38
|
|
|
38
|
|
6477
|
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); |
|
38
|
|
|
|
|
87
|
|
|
38
|
|
|
|
|
14711
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub set_value { |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# use set_value from base class if we have a XML-DateTime format |
13
|
|
|
|
|
|
|
#2037-12-31T00:00:00.0000000+01:00 |
14
|
8
|
100
|
|
8
|
0
|
2539
|
return $_[0]->SUPER::set_value( $_[1] ) if not defined $_[1]; |
15
|
7
|
100
|
|
|
|
29
|
return $_[0]->SUPER::set_value( $_[1] ) |
16
|
|
|
|
|
|
|
if ( |
17
|
|
|
|
|
|
|
$_[1] =~ m{ ^\d{4} \- \d{2} \- \d{2} |
18
|
|
|
|
|
|
|
T \d{2} \: \d{2} \: \d{2} (:? \. \d{1,7} )? |
19
|
|
|
|
|
|
|
[\+\-] \d{2} \: \d{2} $ |
20
|
|
|
|
|
|
|
}xms |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# strptime sets empty values to undef - and strftime doesn't like that... |
24
|
6
|
|
|
|
|
149
|
my @time_from = strptime( $_[1] ); |
25
|
|
|
|
|
|
|
|
26
|
6
|
100
|
|
|
|
685
|
die "Illegal date" if not defined $time_from[5]; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# strftime doesn't like undefs |
29
|
3
|
100
|
|
|
|
5
|
@time_from = map { !defined $_ ? 0 : $_ } @time_from; |
|
21
|
|
|
|
|
52
|
|
30
|
|
|
|
|
|
|
|
31
|
3
|
|
|
|
|
5
|
my $time_str; |
32
|
3
|
50
|
|
|
|
8
|
if ( $time_from[-1] ) { |
33
|
0
|
|
|
|
|
0
|
$time_str = sprintf( |
34
|
|
|
|
|
|
|
'%04d-%02d-%02dT%02d:%02d:%02d.0000000%+03d:%02d', |
35
|
|
|
|
|
|
|
$time_from[5] + 1900, |
36
|
|
|
|
|
|
|
$time_from[4] + 1, |
37
|
|
|
|
|
|
|
$time_from[3], |
38
|
|
|
|
|
|
|
$time_from[2], |
39
|
|
|
|
|
|
|
$time_from[1], |
40
|
|
|
|
|
|
|
$time_from[0], |
41
|
|
|
|
|
|
|
int( $time_from[6] / 3600 ), |
42
|
|
|
|
|
|
|
int( $time_from[6] % 3600 ) / 60 |
43
|
|
|
|
|
|
|
); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
else { |
46
|
3
|
|
|
|
|
9
|
$time_str = strftime( '%Y-%m-%dT%H:%M:%S%z', @time_from ); |
47
|
3
|
|
|
|
|
729
|
substr $time_str, -2, 0, ':'; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
3
|
|
|
|
|
16
|
$_[0]->SUPER::set_value($time_str); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |