1Time::JulianDay(3) User Contributed Perl Documentation Time::JulianDay(3)
2
3
4
6 Time::JulianDay -- Julian calendar manipulations
7
9 use Time::JulianDay
10
11 $jd = julian_day($year, $month_1_to_12, $day)
12 $jd = local_julian_day($seconds_since_1970);
13 $jd = gm_julian_day($seconds_since_1970);
14 ($year, $month_1_to_12, $day) = inverse_julian_day($jd)
15 $dow = day_of_week($jd)
16
17 print (Sun,Mon,Tue,Wed,Thu,Fri,Sat)[$dow];
18
19 $seconds_since_jan_1_1970 = jd_secondslocal($jd, $hour, $min, $sec)
20 $seconds_since_jan_1_1970 = jd_secondsgm($jd, $hour, $min, $sec)
21 $seconds_since_jan_1_1970 = jd_timelocal($sec,$min,$hours,$mday,$month_0_to_11,$year)
22 $seconds_since_jan_1_1970 = jd_timegm($sec,$min,$hours,$mday,$month_0_to_11,$year)
23
25 JulianDay is a package that manipulates dates as number of days since
26 some time a long time ago. It's easy to add and subtract time using
27 julian days...
28
29 The day_of_week returned by day_of_week() is 0 for Sunday, and 6 for
30 Saturday and everything else is in between.
31
33 Time::JulianDay is not a correct implementation. There are two prob‐
34 lems. The first problem is that Time::JulianDay only works with inte‐
35 gers. Julian Day can be fractional to represent time within a day. If
36 you call inverse_julian_day() with a non-integer time, it will often
37 give you an incorrect result.
38
39 The second problem is that Julian Days start at noon rather than mid‐
40 night. The julian_day() function returns results that are too large by
41 0.5.
42
43 What to do about these problems is currently open for debate. I'm
44 tempted to leave the current functions alone and add a second set with
45 more accurate behavior.
46
47 There is another implementation in Astro::Time that may be more accu‐
48 rate.
49
51 Written by David Muir Sharnoff <muir@idiom.com> with help from previous
52 work by Kurt Jaeger aka PI <zrzr0111@helpdesk.rus.uni-stuttgart.de>
53 based on postings from: Ian Miller <ian_m@cix.compulink.co.uk>;
54 Gary Puckering <garyp%cognos.uucp@uunet.uu.net> based on Collected
55 Algorithms of the ACM ?; and the unknown-to-me author of Time::Local.
56
58 Copyright (C) 1996-1999 David Muir Sharnoff. License hereby granted
59 for anyone to use, modify or redistribute this module at their own
60 risk. Please feed useful changes back to muir@idiom.com.
61
62
63
64perl v5.8.8 2003-11-25 Time::JulianDay(3)