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 <https://lists.perl.org/> for more details.
81
82 Please report bugs to
83 <https://github.com/trwyant/perl-DateTime-Calendar-Julian/issues>, or
84 in electronic mail to wyant@cpan.org.
85
87 Eugene van der Pijll <pijll@gmx.net>
88
89 Thomas R. Wyant, III wyant at cpan dot org
90
92 Copyright (c) 2003 Eugene van der Pijll. All rights reserved.
93
94 Copyright (C) 2018-2021 Thomas R. Wyant, III
95
96 This program is free software; you can redistribute it and/or modify it
97 under the same terms as Perl itself.
98
99 This program is distributed in the hope that it will be useful, but
100 without any warranty; without even the implied warranty of
101 merchantability or fitness for a particular purpose.
102
104 DateTime
105
106 DateTime::Calendar::Christian
107
108 datetime@perl.org mailing list
109
110 <http://datetime.perl.org/>
111
112
113
114perl v5.32.1 2021-01-27 DateTime::Calendar::Julian(3)