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'
Returns the difference in days between the Gregorian and the Julian calendar.
print $dt->datetime( $sep ), "\n";
This method is equivalent to
join $sep, $dt->ymd( '-' ), $dt->hms( ':' );
The $sep argument defaults to 'J'.
Caveat: the optional argument was added to this method in version 1.02, to belatedly track a change made in DateTime version 1.43 released 2017-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.
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.
Please report bugs to <https://github.com/trwyant/perl-DateTime-Calendar-Julian/issues>, or in electronic mail to email@example.com.
Thomas R. Wyant, III wyant at cpan dot org
Copyright (C) 2018-2021 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.
firstname.lastname@example.org mailing list