1DateTime::Calendar::JulUisaenr(3C)ontributed Perl DocumeDnattaetTiiomne::Calendar::Julian(3)
2
3
4
6 DateTime::Calendar::Julian - Dates in the Julian calendar
7
9 use DateTime::Calendar::Julian;
10
11 $dt = DateTime::Calendar::Julian->new( year => 964,
12 month => 10,
13 day => 16,
14 );
15
16 # convert Julian->Gregorian...
17
18 $dtgreg = DateTime->from_object( object => $dt );
19 print $dtgreg->datetime; # prints '0964-10-21T00:00:00'
20
21 # ... and back again
22
23 $dtjul = DateTime::Calendar::Julian->from_object( object => $dtgreg );
24 print $dtjul->datetime; # prints '0964-10-16J00:00:00'
25
27 DateTime::Calendar::Julian implements the Julian Calendar. This module
28 implements all methods of DateTime; see the DateTime(3) manpage for all
29 methods.
30
32 This module implements one additional method besides the ones from
33 DateTime, and changes the output of one other method.
34
35 · gregorian_deviation
36
37 Returns the difference in days between the Gregorian and the Julian
38 calendar.
39
40 · datetime
41
42 print $dt->datetime( $sep ), "\n";
43
44 This method is equivalent to
45
46 join $sep, $dt->ymd( '-' ), $dt->hms( ':' );
47
48 The $sep argument defaults to 'J'.
49
50 Caveat: the optional argument was added to this method in version
51 1.02, to belatedly track a change made in DateTime version 1.43
52 released 2017-05-29. Fixing this restores the original
53 stringification behavior of this class, which was to return an
54 ISO-8601 string unless a formatter was set. Before this change, the
55 stringification separated date and time with either a 'T' or a 'J',
56 depending on which version of DateTime was installed.
57
59 The Julian calendar was introduced by Julius Caesar in 46BC. It
60 featured a twelve-month year of 365 days, with a leap year in February
61 every fourth year. This calendar was adopted by the Christian church
62 in 325AD. Around 532AD, Dionysius Exiguus moved the starting point of
63 the Julian calendar to the calculated moment of birth of Jesus Christ.
64 Apart from differing opinions about the start of the year (often
65 January 1st, but also Christmas, Easter, March 25th and other dates),
66 this calendar remained unchanged until the calendar reform of pope
67 Gregory XIII in 1582. Some backward countries, however, used the
68 Julian calendar until the 18th century or later.
69
70 This module uses the proleptic Julian calendar for years before 532AD,
71 or even 46BC. This means that dates are calculated as if this calendar
72 had existed unchanged from the beginning of time. The assumption is
73 made that January 1st is the first day of the year.
74
75 Note that BC years are given as negative numbers, with 0 denoting the
76 year 1BC (there was no year 0AD!), -1 the year 2BC, etc.
77
79 Support for this module is provided via the datetime@perl.org email
80 list. See http://lists.perl.org/ for more details.
81
82 Bug reports will be accepted as RT tickets or by mail to Wyant.
83
85 Eugene van der Pijll <pijll@gmx.net>
86
87 Thomas R. Wyant, III wyant at cpan dot org
88
90 Copyright (c) 2003 Eugene van der Pijll. All rights reserved.
91
92 Copyright (C) 2018-2019 Thomas R. Wyant, III
93
94 This program is free software; you can redistribute it and/or modify it
95 under the same terms as Perl itself.
96
97 This program is distributed in the hope that it will be useful, but
98 without any warranty; without even the implied warranty of
99 merchantability or fitness for a particular purpose.
100
102 DateTime
103
104 DateTime::Calendar::Christian
105
106 datetime@perl.org mailing list
107
108 <http://datetime.perl.org/>
109
110
111
112perl v5.30.1 2019-11-20 DateTime::Calendar::Julian(3)