line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Date::Converter::Ethiopian; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1333
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
53
|
|
4
|
1
|
|
|
1
|
|
6
|
use base 'Date::Converter'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
90
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use vars qw($VERSION); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
109
|
|
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 ($y_prime, $m_prime, $d_prime, $j1, $j2); |
15
|
|
|
|
|
|
|
{ |
16
|
1
|
|
|
1
|
|
6
|
use integer; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
9
|
|
|
0
|
|
|
|
|
0
|
|
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
0
|
$y_prime = $y + 4720 - (13 - $m) / 13; |
19
|
0
|
|
|
|
|
0
|
$m_prime = ($m + 12) % 13; |
20
|
0
|
|
|
|
|
0
|
$d_prime = $d - 1; |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
0
|
$j1 = (1461 * $y_prime) / 4; |
23
|
0
|
|
|
|
|
0
|
$j2 = 30 * $m_prime; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
0
|
my $jed = $j1 + $j2 + $d_prime - 124 - 0.5; |
27
|
0
|
|
|
|
|
0
|
$jed += $f; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
0
|
return $jed; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub jed_to_ymdf { |
33
|
33
|
|
|
33
|
0
|
32300
|
my ($jed) = @_; |
34
|
|
|
|
|
|
|
|
35
|
33
|
|
|
|
|
64
|
my $j = int ($jed + 0.5); |
36
|
33
|
|
|
|
|
49
|
my $f = ($jed + 0.5) - $j; |
37
|
|
|
|
|
|
|
|
38
|
33
|
|
|
|
|
35
|
my ($j_prime, $y_prime, $t_prime, $m_prime, $d_prime, $y, $m, $d); |
39
|
|
|
|
|
|
|
{ |
40
|
1
|
|
|
1
|
|
235
|
use integer; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
|
33
|
|
|
|
|
35
|
|
41
|
|
|
|
|
|
|
|
42
|
33
|
|
|
|
|
39
|
$j_prime = $j + 124; |
43
|
|
|
|
|
|
|
|
44
|
33
|
|
|
|
|
40
|
$y_prime = (4 * $j_prime + 3) / 1461; |
45
|
33
|
|
|
|
|
47
|
$t_prime = ((4 * $j_prime + 3) % 1461) / 4; |
46
|
33
|
|
|
|
|
36
|
$m_prime = $t_prime / 30; |
47
|
33
|
|
|
|
|
40
|
$d_prime = $t_prime % 30; |
48
|
|
|
|
|
|
|
|
49
|
33
|
|
|
|
|
35
|
$d = $d_prime + 1; |
50
|
33
|
|
|
|
|
34
|
$m = ($m_prime %13) + 1; |
51
|
33
|
|
|
|
|
47
|
$y = $y_prime - 4720 + (13 - $m) / 13; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
33
|
|
|
|
|
305
|
return ($y, $m, $d, $f); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |