line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Date::Converter::Macedonian; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1627
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
114
|
|
4
|
1
|
|
|
1
|
|
6
|
use base 'Date::Converter'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
94
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use vars qw($VERSION); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
111
|
|
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, $j1, $j2); |
20
|
|
|
|
|
|
|
{ |
21
|
1
|
|
|
1
|
|
7
|
use integer; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
|
0
|
|
|
|
|
0
|
|
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
0
|
$y_prime = $y + 4405 - (18 - $m) / 12; |
24
|
0
|
|
|
|
|
0
|
$m_prime = ($m + 5) % 12; |
25
|
0
|
|
|
|
|
0
|
$d_prime = $d - 1; |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
0
|
$j1 = (1461 * $y_prime) / 4; |
28
|
0
|
|
|
|
|
0
|
$j2 = (153 * $m_prime + 2) / 5; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
0
|
my $jed = $j1 + $j2 + $d_prime - 1401 - 0.5; |
32
|
0
|
|
|
|
|
0
|
$jed += $f; |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
0
|
return $jed; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub jed_to_ymdf { |
38
|
33
|
|
|
33
|
0
|
19448
|
my ($jed) = @_; |
39
|
|
|
|
|
|
|
|
40
|
33
|
|
|
|
|
62
|
my $j = int ($jed + 0.5); |
41
|
33
|
|
|
|
|
146
|
my $f = ($jed + 0.5) - $j; |
42
|
|
|
|
|
|
|
|
43
|
33
|
|
|
|
|
39
|
my ($j_prime, $y_prime, $t_prime, $m_prime, $d_prime, $y, $m, $d); |
44
|
|
|
|
|
|
|
{ |
45
|
1
|
|
|
1
|
|
172
|
use integer; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
|
33
|
|
|
|
|
31
|
|
46
|
|
|
|
|
|
|
|
47
|
33
|
|
|
|
|
38
|
$j_prime = $j + 1401; |
48
|
|
|
|
|
|
|
|
49
|
33
|
|
|
|
|
50
|
$y_prime = (4 * $j_prime + 3) / 1461; |
50
|
33
|
|
|
|
|
548
|
$t_prime = ((4 * $j_prime + 3) % 1461) / 4; |
51
|
33
|
|
|
|
|
34
|
$m_prime = (5 * $t_prime + 2) / 153; |
52
|
33
|
|
|
|
|
36
|
$d_prime = ((5 * $t_prime + 2) % 153) / 5; |
53
|
|
|
|
|
|
|
|
54
|
33
|
|
|
|
|
41
|
$d = $d_prime + 1; |
55
|
33
|
|
|
|
|
44
|
$m = (($m_prime + 6) % 12 ) + 1; |
56
|
33
|
|
|
|
|
46
|
$y = $y_prime - 4405 + (18 - $m) / 12; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
33
|
|
|
|
|
297
|
return ($y, $m, $d, $f); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |