1DateTime::Format::EpochU:s:eJrD(C3o)ntributed Perl DocumDeantteaTtiimoen::Format::Epoch::JD(3)
2
3
4
6 DateTime::Format::Epoch::JD - Convert DateTimes to/from Julian Days
7
9 use DateTime::Format::Epoch::JD;
10
11 my $dt = DateTime::Format::Epoch::JD->parse_datetime( 2453244.5 );
12 # 2004-08-27T00:00:00
13 DateTime::Format::Epoch::JD->format_datetime($dt);
14 # 2453244.5
15
16 my $formatter = DateTime::Format::Epoch::JD->new();
17 my $dt2 = $formatter->parse_datetime( 2453244.5 );
18 # 2004-08-27T00:00:00
19 $formatter->format_datetime($dt2);
20 # 2453244.5
21
23 This module can convert a DateTime object (or any object that can be
24 converted to a DateTime object) to the Julian Day number. This is the
25 number of days since noon U.T.C. on January 1, 4713 B.C. (Julian
26 calendar).
27
28 This time scale was originally proposed by John Herschel, and is often
29 used in astronomical calculations.
30
31 Similar modules are:
32
33 · DateTime::Format::Epoch::MJD
34
35 Implements the "modified Julian Day", starting at midnight U.T.C.,
36 November 17, 1858. This number is always 2,400,000.5 lower than
37 the JD, and this count only uses five digits to specify a date
38 between 1859 and about 2130.
39
40 · DateTime::Format::Epoch::RJD
41
42 Implements the "reduced Julian Day", starting at noon U.T.C.,
43 November 16, 1858. This number is always 2,400,000 lower than the
44 JD.
45
46 · DateTime::Format::Epoch::TJD
47
48 Implements the "truncated Julian Day", starting at midnight U.T.C.,
49 May 24, 1968. This number is always 2,440,000,5 lower than the JD.
50 Actually, there is another version of the TJD, defined as JD modulo
51 10,000. But that one is a bit harder to implement, so you'll have
52 to do with this version of TJD. Or don't use TJD's at all.
53
54 · DateTime::Format::Epoch::RataDie
55
56 Implements the Rata Die count, starting at January 1, 1
57 (Gregorian). This count is used by DateTime::Calendar programmers.
58
59 · DateTime::Format::Epoch::Lilian
60
61 Implements the Lilian count, named after Aloysius Lilian (a 16th
62 century physician) and first used by IBM (a 19th century punched
63 card machine manufacturer). This counts the number of days since
64 the adoption of the Gregorian calendar. Only days are counted, and
65 October 15, 1584 is day 1.
66
68 Most of the methods are the same as those in DateTime::Format::Epoch.
69 The only difference is the constructor.
70
71 · new()
72
73 Constructor of the formatter/parser object. It has no parameters.
74
76 Support for this module is provided via the datetime@perl.org email
77 list. See http://lists.perl.org/ for more details.
78
80 Eugene van der Pijll <pijll@gmx.net>
81
83 Copyright (c) 2004 Eugene van der Pijll. All rights reserved. This
84 program is free software; you can redistribute it and/or modify it
85 under the same terms as Perl itself.
86
88 DateTime
89
90 datetime@perl.org mailing list
91
92
93
94perl v5.12.3 2011-08-29 DateTime::Format::Epoch::JD(3)