develooper Front page | perl.perlfaq.workers | Postings from January 2005

perlfaq4: How can I find the Julian Day?

Thread Next
From:
_brian_d_foy
Date:
January 31, 2005 08:13
Subject:
perlfaq4: How can I find the Julian Day?
Message ID:
310120051013410974%comdog@panix.com

* I pared down the answer.  I'm not a big calendar calculating
type of person, but I found the last paragraph confusing.  I'm
guessing that it's correct, but I don't think it really helps
someone who doesn't know about calenders or Julian days already.
I distilled David's suggestions into a couple of sentences.

*  Instead of discussing julian days, I punted to an external
discussion which seems clear and complete, and includes examples
of calculations involving julian days.

Index: perlfaq4.pod
===================================================================
RCS file: /cvs/public/perlfaq/perlfaq4.pod,v
retrieving revision 1.59
diff -u -d -r1.59 perlfaq4.pod
--- perlfaq4.pod        19 Jan 2005 16:09:31 -0000      1.59
+++ perlfaq4.pod        31 Jan 2005 16:09:38 -0000
@@ -454,26 +454,17 @@
 
 =head2 How can I find the Julian Day?
 
-Use the Time::JulianDay module (part of the Time-modules bundle
-available from CPAN.)
+(contributed by brian d foy)
 
-Before you immerse yourself too deeply in this, be sure to verify that
-it is the I<Julian> Day you really want.  Are you interested in a way
-of getting serial days so that you just can tell how many days they
-are apart or so that you can do also other date arithmetic?  If you
-are interested in performing date arithmetic, this can be done using
-modules Date::Manip or Date::Calc.
+You can use the Time::JulianDay module available on CPAN.  Ensure that
+you really want to find a Julian day, though, as many people have
+different ideas about Julian days.  See
+http://www.hermetic.ch/cal_stud/jdn.htm for instance.
 
-There is too many details and much confusion on this issue to cover in
-this FAQ, but the term is applied (correctly) to a calendar now
-supplanted by the Gregorian Calendar, with the Julian Calendar failing
-to adjust properly for leap years on centennial years (among other
-annoyances).  The term is also used (incorrectly) to mean: [1] days in
-the Gregorian Calendar; and [2] days since a particular starting time
-or `epoch', usually 1970 in the Unix world and 1980 in the
-MS-DOS/Windows world.  If you find that it is not the first meaning
-that you really want, then check out the Date::Manip and Date::Calc
-modules.  (Thanks to David Cassell for most of this text.)
+If you need this for date arithmetic, you might also try the
+Date::Manip or Date::Calc modules.  If you want to calculate days
+since a particular starting date, such as the unix epoch, you probably
+want one of the Date::* modules.
 
 =head2 How do I find yesterday's date?

-- 
brian d foy, comdog@panix.com

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About