line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Date::Converter::Armenian; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
4624
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
362
|
|
4
|
1
|
|
|
1
|
|
124
|
use base 'Date::Converter'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
287
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use vars qw($VERSION); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
161
|
|
7
|
|
|
|
|
|
|
$VERSION = 1.1; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# E G Richards, |
10
|
|
|
|
|
|
|
# Algorithm E, |
11
|
|
|
|
|
|
|
# Mapping Time, The Calendar and Its History, |
12
|
|
|
|
|
|
|
# Oxford, 1999, pages 323-325. |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub ymdf_to_jed { |
15
|
0
|
|
|
0
|
0
|
0
|
my ($y, $m, $d, $f) = @_; |
16
|
|
|
|
|
|
|
|
17
|
0
|
0
|
|
|
|
0
|
$f = 0 unless defined $f; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
0
|
my ($y_prime, $m_prime, $d_prime); |
20
|
|
|
|
|
|
|
{ |
21
|
1
|
|
|
1
|
|
5
|
use integer; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
|
0
|
|
|
|
|
0
|
|
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
0
|
$y_prime = $y + 5268 - (13 - $m) / 13; |
24
|
0
|
|
|
|
|
0
|
$m_prime = ($m + 12) % 13; |
25
|
0
|
|
|
|
|
0
|
$d_prime = $d - 1; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
0
|
my $jed = 365 * $y_prime + 30 * $m_prime + $d_prime - 317 - 0.5; |
29
|
0
|
|
|
|
|
0
|
$jed += $f; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
0
|
return $jed; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub jed_to_ymdf { |
35
|
33
|
|
|
33
|
0
|
27589
|
my ($jed) = @_; |
36
|
|
|
|
|
|
|
|
37
|
33
|
|
|
|
|
69
|
my $j = int ($jed + 0.5); |
38
|
33
|
|
|
|
|
189
|
my $f = ($jed + 0.5) - $j; |
39
|
|
|
|
|
|
|
|
40
|
33
|
|
|
|
|
36
|
my ($j_prime, $y_prime, $t_prime, $m_prime, $d_prime, $y, $m, $d); |
41
|
|
|
|
|
|
|
{ |
42
|
1
|
|
|
1
|
|
305
|
use integer; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
|
33
|
|
|
|
|
39
|
|
43
|
|
|
|
|
|
|
|
44
|
33
|
|
|
|
|
38
|
$j_prime = $j + 317; |
45
|
|
|
|
|
|
|
|
46
|
33
|
|
|
|
|
33
|
$y_prime = $j_prime / 365; |
47
|
33
|
|
|
|
|
37
|
$t_prime = $j_prime % 365; |
48
|
33
|
|
|
|
|
37
|
$m_prime = $t_prime / 30; |
49
|
33
|
|
|
|
|
62
|
$d_prime = $t_prime % 30; |
50
|
|
|
|
|
|
|
|
51
|
33
|
|
|
|
|
191
|
$d = $d_prime + 1; |
52
|
33
|
|
|
|
|
108
|
$m = ($m_prime % 13) + 1; |
53
|
33
|
|
|
|
|
49
|
$y = $y_prime - 5268 + (13 - $m) / 13; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
33
|
|
|
|
|
1470
|
return ($y, $m, $d, $f); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |