line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Time::NT; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
53212
|
use 5.006_001; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
79
|
|
4
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
71
|
|
5
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
298
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.007'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our (@ISA, @EXPORT_OK, %EXPORT_TAGS); |
10
|
|
|
|
|
|
|
BEGIN { |
11
|
2
|
|
|
2
|
|
11
|
require Exporter; |
12
|
2
|
|
|
|
|
35
|
@ISA = qw(Exporter); |
13
|
2
|
|
|
|
|
8
|
%EXPORT_TAGS = ( 'all' => [ qw(nt_to_unix unix_to_nt nt_time) ] ); |
14
|
2
|
|
|
|
|
4
|
@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
|
2
|
|
|
|
|
308
|
|
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub nt_to_unix { |
18
|
1
|
|
|
1
|
1
|
2
|
my $ntTime = shift; |
19
|
1
|
|
|
|
|
7
|
$ntTime =~ s/[0-9]{7}$//; |
20
|
1
|
|
|
|
|
9
|
return int($ntTime) - 11644473600; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub unix_to_nt { |
24
|
1
|
|
|
1
|
1
|
13
|
my $unixTime = shift; |
25
|
1
|
|
|
|
|
2
|
$unixTime += 11644473600; |
26
|
1
|
|
|
|
|
6
|
return "${unixTime}0000000"; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub nt_time { |
30
|
0
|
|
|
0
|
1
|
|
return unix_to_nt(time); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
__END__ |