line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Date::Converter::Tamil; |
2
|
|
|
|
|
|
|
# Also known as Hundu Solar |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
1298
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
49
|
|
5
|
1
|
|
|
1
|
|
6
|
use base 'Date::Converter'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
106
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
7
|
use vars qw($VERSION); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
357
|
|
8
|
|
|
|
|
|
|
$VERSION = 1.1; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# E Reingold, N Dershowitz, S Clamen, |
11
|
|
|
|
|
|
|
# Calendrical Calculations, II: Three Historical Calendars, |
12
|
|
|
|
|
|
|
# Software - Practice and Experience, |
13
|
|
|
|
|
|
|
# Volume 23, Number 4, pages 383-404, April 1993. |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub ymdf_to_jed { |
16
|
0
|
|
|
0
|
0
|
0
|
my ($y, $m, $d, $f) = @_; |
17
|
|
|
|
|
|
|
|
18
|
0
|
0
|
|
|
|
0
|
$f = 0 unless defined $f; |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
0
|
my $jed_epoch = epoch_to_jed(); |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
0
|
my $jed = |
23
|
|
|
|
|
|
|
$jed_epoch + |
24
|
|
|
|
|
|
|
($d - 1) + |
25
|
|
|
|
|
|
|
($m - 1) * month_length() + |
26
|
|
|
|
|
|
|
$y * year_length(); |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
0
|
$jed += $f; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
0
|
return $jed; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub jed_to_ymdf { |
34
|
33
|
|
|
33
|
0
|
18809
|
my ($jed) = @_; |
35
|
|
|
|
|
|
|
|
36
|
33
|
|
|
|
|
71
|
my $jed_epoch = epoch_to_jed(); |
37
|
|
|
|
|
|
|
|
38
|
33
|
|
|
|
|
67
|
my $j = int ($jed - $jed_epoch); |
39
|
33
|
|
|
|
|
53
|
my $f = ($jed - $jed_epoch) - $j; |
40
|
|
|
|
|
|
|
|
41
|
33
|
|
|
|
|
51
|
my $y = int ($j / year_length()); |
42
|
33
|
|
|
|
|
59
|
$j -= int ($y * year_length()); |
43
|
33
|
|
|
|
|
63
|
my $m = 1 + int ($j / month_length()); |
44
|
33
|
|
|
|
|
61
|
$j -= int (($m - 1) * month_length()); |
45
|
|
|
|
|
|
|
|
46
|
33
|
|
|
|
|
40
|
my $d = 1 + $j; |
47
|
|
|
|
|
|
|
|
48
|
33
|
|
|
|
|
290
|
return ($y, $m, $d, $f); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub epoch_to_jed { |
52
|
|
|
|
|
|
|
# my ($jed) = @_; |
53
|
|
|
|
|
|
|
|
54
|
33
|
|
|
33
|
0
|
63
|
return 588466.75; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub month_length { |
58
|
66
|
|
|
66
|
0
|
88
|
return year_length() / 12.0; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub year_length { |
62
|
132
|
|
|
132
|
0
|
370
|
return 1577917828.0 / 4320000.0; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |