line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Date::Converter::Syrian; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1546
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
56
|
|
4
|
1
|
|
|
1
|
|
6
|
use base 'Date::Converter'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
94
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use vars qw($VERSION); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
121
|
|
7
|
|
|
|
|
|
|
$VERSION = 1.1; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# E G Richards, |
10
|
|
|
|
|
|
|
# Algorithm F, |
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
|
|
6
|
use integer; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
|
0
|
|
|
|
|
0
|
|
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
0
|
$y_prime = $y + 4405 - (17 - $m) / 12; |
24
|
0
|
|
|
|
|
0
|
$m_prime = ($m + 6) % 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
|
18482
|
my ($jed) = @_; |
39
|
|
|
|
|
|
|
|
40
|
33
|
|
|
|
|
60
|
my $j = int ($jed + 0.5); |
41
|
33
|
|
|
|
|
49
|
my $f = ($jed + 0.5) - $j; |
42
|
|
|
|
|
|
|
|
43
|
33
|
|
|
|
|
34
|
my ($j_prime, $y_prime, $t_prime, $m_prime, $d_prime, $y, $m, $d); |
44
|
|
|
|
|
|
|
{ |
45
|
1
|
|
|
1
|
|
167
|
use integer; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
|
33
|
|
|
|
|
33
|
|
46
|
|
|
|
|
|
|
|
47
|
33
|
|
|
|
|
31
|
$j_prime = $j + 1401; |
48
|
|
|
|
|
|
|
|
49
|
33
|
|
|
|
|
182
|
$y_prime = (4 * $j_prime + 3) / 1461; |
50
|
33
|
|
|
|
|
38
|
$t_prime = ((4 * $j_prime + 3) % 1461 ) / 4; |
51
|
33
|
|
|
|
|
36
|
$m_prime = (5 * $t_prime + 2) / 153; |
52
|
33
|
|
|
|
|
34
|
$d_prime = ((5 * $t_prime + 2) % 153) / 5; |
53
|
|
|
|
|
|
|
|
54
|
33
|
|
|
|
|
32
|
$d = $d_prime + 1; |
55
|
33
|
|
|
|
|
42
|
$m = (($m_prime + 5) % 12) + 1; |
56
|
33
|
|
|
|
|
44
|
$y = $y_prime - 4405 + (17 - $m) / 12; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
33
|
|
|
|
|
263
|
return ($y, $m, $d, $f); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |