line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FormValidator::LazyWay::Fix::DateTime; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
17
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
103
|
|
4
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
77
|
|
5
|
3
|
|
|
3
|
|
3552
|
use DateTime::Format::Strptime; |
|
3
|
|
|
|
|
715357
|
|
|
3
|
|
|
|
|
481
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub format { |
8
|
3
|
|
|
3
|
0
|
7
|
my $text = shift; |
9
|
3
|
|
50
|
|
|
9
|
my $args = shift || { pattern => '%Y-%m-%d %H:%M:%S' }; |
10
|
|
|
|
|
|
|
|
11
|
3
|
50
|
|
|
|
9
|
return unless $text; |
12
|
|
|
|
|
|
|
|
13
|
3
|
|
|
|
|
5
|
my $strp = DateTime::Format::Strptime->new( %{$args} ); |
|
3
|
|
|
|
|
35
|
|
14
|
3
|
|
|
|
|
1797
|
my $dt = $strp->parse_datetime($text); |
15
|
3
|
|
|
|
|
2736
|
return $dt; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
1; |