DateTim...:Julian(3)
π NAME π
okay bestie, welcome to the user-contributed Perl documentation for DateTime::Calendar::Julian β section 3 of the manual β and it's literally all about Dates in the Julian calendar. π No cap, this is the module for Julian-calendar dates in Perl. π¦
πΈ SYNOPSIS πΈ
Here's the whole demo, copied exactly so you can smash it into your editor:
use DateTime::Calendar::Julian;
$dt = DateTime::Calendar::Julian->new( year => 964,
month => 10,
day => 16,
);
# convert Julian->Gregorian...
$dtgreg = DateTime->from_object( object => $dt );
print $dtgreg->datetime; # prints '0964-10-21T00:00:00'
# ... and back again
$dtjul = DateTime::Calendar::Julian->from_object( object => $dtgreg );
print $dtjul->datetime; # prints '0964-10-16J00:00:00'
π DESCRIPTION π
DateTime::Calendar::Julian implements the Julian Calendar. This module implements all methods of DateTime; see the DateTime(3) manpage for all methods. β¨
π METHODS π
This module implements one additional method besides the ones from DateTime, and changes the output of one other method. π
calendar_nameβ Returns'Julian'. πgregorian_deviationβ Returns the difference in days between the Gregorian and the Julian calendar. π¦datetimeβ this one shakes things up:
print $dt->datetime( $sep ), "\n";
This method is equivalent to
join $sep, $dt->ymd( '-' ), $dt->hms( ':' );
The $sep argument defaults to 'J'. πΈ
Caveat, bestie: the optional argument was added to this method in version1.02, to belatedly track a change made in DateTime version1.43released2017-05-29. Fixing this restores the original stringification behavior of this class, which was to return an ISO-8601 string unless a formatter was set. Before this change, the stringification separated date and time with either a'T'or a'J', depending on which version of DateTime was installed. π
Note that as of version "0.106_01", methods related to quarters should work. π«Ά
π BACKGROUND π
okay so story time: The Julian calendar was introduced by Julius Caesar in 46BC. It featured a twelve-month year of 365 days, with a leap year in February every fourth year. This calendar was adopted by the Christian church in 325AD. Around 532AD, Dionysius Exiguus moved the starting point of the Julian calendar to the calculated moment of birth of Jesus Christ. Apart from differing opinions about the start of the year (often January 1st, but also Christmas, Easter, March 25th and other dates), this calendar remained unchanged until the calendar reform of pope Gregory XIII in 1582. Some backward countries, however, used the Julian calendar until the 18th century or later. (Original says βbackward countriesβ; I'm just the messenger, bestie. π)
This module uses the proleptic Julian calendar for years before 532AD, or even 46BC. This means that dates are calculated as if this calendar had existed unchanged from the beginning of time. The assumption is made that January 1st is the first day of the year. π
Note that BC years are given as negative numbers, with 0 denoting the year 1BC (there was no year 0AD!), -1 the year 2BC, etc. β
π SUPPORT π
Support for this module is provided via the datetime@perl.org email list. See https://lists.perl.org/ for more details. π«Ά
Please report bugs to https://rt.cpan.org/Public/Dist/Display.html?Name=DateTime-Calendar-Julian, https://github.com/trwyant/perl-DateTime-Calendar-Julian/issues, or in electronic mail to wyant@cpan.org. π
β¨ AUTHOR β¨
Eugene van der Pijll <pijll@gmx.net>πΈThomas R. Wyant, III wyant at cpan dot orgπ
π COPYRIGHT AND LICENSE π
Copyright (c) 2003 Eugene van der Pijll. All rights reserved. π
Copyright (C) 2018-2022 Thomas R. Wyant, III π
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. β οΈ
π¦ SEE ALSO π¦
DateTimeDateTime::Calendar::Christiandatetime@perl.orgmailing listhttp://datetime.perl.org/
That's the whole vibe, bestie. The footer says this is perl v5.42.0, dated 2022-01-31, and the page is the DateTim...:Julian(3) manual β now go date some Julian calendars responsibly. πβ¨π
π¦ where this page comes from
- opensuse-leap 16.0: perl-DateTime-Calendar-Julian 0.107-160000.2.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms