line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SOAP::WSDL::XSD::Typelib::Builtin::dateTime; |
2
|
36
|
|
|
36
|
|
620
|
use strict; |
|
36
|
|
|
|
|
40
|
|
|
36
|
|
|
|
|
911
|
|
3
|
36
|
|
|
36
|
|
122
|
use warnings; |
|
36
|
|
|
|
|
38
|
|
|
36
|
|
|
|
|
774
|
|
4
|
36
|
|
|
36
|
|
104
|
use Date::Parse; |
|
36
|
|
|
|
|
34
|
|
|
36
|
|
|
|
|
2586
|
|
5
|
36
|
|
|
36
|
|
136
|
use Date::Format; |
|
36
|
|
|
|
|
38
|
|
|
36
|
|
|
|
|
1527
|
|
6
|
|
|
|
|
|
|
|
7
|
36
|
|
|
36
|
|
551
|
use Class::Std::Fast::Storable constructor => 'none', cache => 1; |
|
36
|
|
|
|
|
14161
|
|
|
36
|
|
|
|
|
170
|
|
8
|
36
|
|
|
36
|
|
3370
|
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType); |
|
36
|
|
|
|
|
53
|
|
|
36
|
|
|
|
|
8285
|
|
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
|
1221
|
return $_[0]->SUPER::set_value( $_[1] ) if not defined $_[1]; |
15
|
7
|
100
|
|
|
|
18
|
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
|
|
|
|
|
111
|
my @time_from = strptime( $_[1] ); |
25
|
|
|
|
|
|
|
|
26
|
6
|
100
|
|
|
|
283
|
die "Illegal date" if not defined $time_from[5]; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# strftime doesn't like undefs |
29
|
3
|
100
|
|
|
|
3
|
@time_from = map { !defined $_ ? 0 : $_ } @time_from; |
|
21
|
|
|
|
|
28
|
|
30
|
|
|
|
|
|
|
|
31
|
3
|
|
|
|
|
4
|
my $time_str; |
32
|
3
|
50
|
|
|
|
4
|
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
|
|
|
|
|
6
|
$time_str = strftime( '%Y-%m-%dT%H:%M:%S%z', @time_from ); |
47
|
3
|
|
|
|
|
429
|
substr $time_str, -2, 0, ':'; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
3
|
|
|
|
|
12
|
$_[0]->SUPER::set_value($time_str); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |