line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Date::Converter::Zoroastrian; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
2181
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
54
|
|
4
|
1
|
|
|
1
|
|
7
|
use base 'Date::Converter'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
101
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use vars qw($VERSION); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
229
|
|
7
|
|
|
|
|
|
|
$VERSION = 1.1; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub ymdf_to_jed { |
10
|
0
|
|
|
0
|
0
|
0
|
my ($y, $m, $d, $f) = @_; |
11
|
|
|
|
|
|
|
|
12
|
0
|
0
|
|
|
|
0
|
$f = 0 unless defined $f; |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
|
|
0
|
my $jed_epoch = epoch_to_jed(); |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
0
|
my $jed = $jed_epoch + (($d - 1) + 30 * ($m - 1) + 365 * ($y - 1)); |
17
|
0
|
|
|
|
|
0
|
$jed += $f; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
0
|
return $jed; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub jed_to_ymdf { |
23
|
32
|
|
|
32
|
0
|
17953
|
my ($jed) = @_; |
24
|
|
|
|
|
|
|
|
25
|
32
|
|
|
|
|
63
|
my $jed_epoch = epoch_to_jed(); |
26
|
|
|
|
|
|
|
|
27
|
32
|
|
|
|
|
63
|
my $j = int ($jed - $jed_epoch); |
28
|
32
|
|
|
|
|
50
|
my $f = ($jed - $jed_epoch) - $j; |
29
|
|
|
|
|
|
|
|
30
|
32
|
|
|
|
|
33
|
my ($y, $m, $d); |
31
|
|
|
|
|
|
|
{ |
32
|
1
|
|
|
1
|
|
6
|
use integer; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
14
|
|
|
32
|
|
|
|
|
31
|
|
33
|
|
|
|
|
|
|
|
34
|
32
|
|
|
|
|
41
|
$d = 1 + $j; |
35
|
32
|
|
|
|
|
37
|
$m = 1; |
36
|
32
|
|
|
|
|
27
|
$y = 1; |
37
|
|
|
|
|
|
|
|
38
|
32
|
|
|
|
|
41
|
my $years = ($d - 1) / 365; |
39
|
32
|
|
|
|
|
35
|
$y += $years; |
40
|
32
|
|
|
|
|
34
|
$d -= $years * 365; |
41
|
|
|
|
|
|
|
|
42
|
32
|
|
|
|
|
39
|
my $months = ($d - 1) / 30; |
43
|
32
|
|
|
|
|
34
|
$m += $months; |
44
|
32
|
|
|
|
|
43
|
$d = $d - $months * 30; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
32
|
|
|
|
|
287
|
return ($y, $m, $d, $f); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub epoch_to_jed { |
51
|
32
|
|
|
32
|
0
|
48
|
return 1579768.5; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |