view release on metacpan or search on metacpan
lib/Date/Vruceleto.pm view on Meta::CPAN
=encoding UTF-8
=head1 NAME
Date::Vruceleto - Compute year's vruceleto and solar cycle as used in
old Russian calendar
=head1 SYNOPSIS
use Date::Vruceleto;
$letter = vruceleto(2016); # NB: means year 2016 since March 1, 5508 BCE
lib/Date/Vruceleto.pm view on Meta::CPAN
other dating techniques.
The cycle of correspondences between vruceletos and the days of the
week is repeated every 28 years, a period also used in old Russian
chronology as "solar cycle". The count of solar cycles in this
calendar system starts from March 1, 5508 BCE (called Constantinople
World Aera).
I.A.Klimishin in his book "Calendar and Chronology" (Moscow, Nauka,
1985, pp. 66-70) gives the following formulae to calculate solar
cycles and vruceletos ([] meaning the integer part of the quotient and
lib/Date/Vruceleto.pm view on Meta::CPAN
The module is intended to find only "the vruceleto of the year" and
not to be used as a Perpetual Calendar, though it may be helpful in
building some tools that achieve that goal.
The module is intended for use in work with old Russian texts as well
as ecclesiastical calculations, i.e. where Julian calendar is
common. Usage with Gregorian calendar is generally senseless and thus
untested.
=head2 EXPORT
None by default. I<solarcycle>, I<vruceleto> and I<vrutseleto> can be
view all matches for this distribution
view release on metacpan or search on metacpan
WeekOfYear.pm view on Meta::CPAN
my $weekNo = WeekOfYear($the_time, 1); # Week number for $the_time in pre ISO 8601 mode
=head1 ISO 8601
Weeks in a Gregorian calendar year can be numbered for each year. This style of
numbering is commonly used (for example, by schools and businesses) in some European
and Asian countries, but rare elsewhere.
ISO 8601 includes the ISO week date system, a numbering system for weeks - each week
begins on a Monday and is associated with the year that contains that week's Thursday
view all matches for this distribution
view release on metacpan or search on metacpan
# methods that are recommended if applicable:
# year, month, day, is_leap
$BEGINNING=1721426; # 1 Jan 1 in the Gregorian calendar, although technically,
# the Gregorian calendar didn't exist at the time.
$VERSION_TODAY=2450522; # today in JDN, when I wrote this.
sub new { # straight out of the perlobj manpage:
my $class = shift;
package Date::Convert::Gregorian;
use Carp;
@ISA = qw ( Date::Convert );
$GREG_BEGINNING=1721426; # 1 Jan 1 in the Gregorian calendar, although
# technically, the Gregorian calendar didn't exist at
# the time.
@MONTHS_SHORT = qw ( nil Jan Feb Mar Apr May Jun July Aug Sep Oct Nov Dec );
@MONTH_ENDS = qw ( 0 31 59 90 120 151 181 212 243 273 304 334 365 );
@LEAP_ENDS = qw ( 0 31 60 91 121 152 182 213 244 274 305 335 366 );
@MONTHS = ('Nissan', 'Iyyar', 'Sivan', 'Tammuz', 'Av',
'Elul', 'Tishrei', 'Cheshvan', 'Kislev', 'Teves',
'Shevat', 'Adar', 'Adar II' );
# In the Hebrew calendar, the year starts in the seventh month, there can
# be a leap month, and there are two months with a variable number of days.
# Rather than calculate do the actual math, let's set up lookup tables based
# on year length. :)
%MONTH_START=
my $self = shift;
return $$self{year} if exists $$self{year};
my $days=$$self{absol};
my $year=int($days/365)-3*365; # just an initial guess, but a good one.
warn "Date::Convert::Hebrew isn't reliable before the beginning of\n".
"\tthe Hebrew calendar" if $days < $HEBREW_BEGINNING;
$year++ while rosh Date::Convert::Hebrew ($year+1)<=$days;
$$self{year}=$year;
$$self{days}=$days-(rosh Date::Convert::Hebrew $year)+1;
return $year;
}
=head1 SUBCLASS SPECIFIC NOTES
=head2 Absolute
The "Absolute" calendar is just the number of days from a certain reference
point. Calendar people should recognize it as the "Julian Day Number" with
one minor modification: When you convert a Gregorian day n to absolute,
you get the JDN of the Gregorian day from noon on.
Since "absolute" has no notion of years it is an extremely easy calendar
for conversion purposes. I stole the "absolute" calendar format from
Reingold's emacs calendar mode, for debugging purposes.
The subclass is little more than the base class, and as the lowest common
denominator, doesn't have any special functions.
=head2 Gregorian
The Gregorian calendar is a purely solar calendar, with a month that is
only an approximation of a lunar month. It is based on the old Julian
(Roman) calendar. This is the calendar that has been used by most of the
Western world for the last few centuries. The time of its adoption varies
from country to country. This B<::Gregorian> allows you to extrapolate
back to 1 A.D., as per the prorgamming tradition, even though the calendar
definitely was not in use then.
In addition to the required methods, B<Gregorian> also has B<year>,
B<month>, B<day>, and B<is_leap> methods. As mentioned above, B<is_leap>
can also be used statically.
=head2 Hebrew
This is the traditional Jewish calendar. It's based on the solar year, on
the lunar month, and on a number of additional rules created by Rabbis to
make life tough on people who calculate calendars. :) If you actually wade
through the source, you should note that the seventh month really does come
before the first month, that's not a bug.
It comes with the following additional methods: B<year>, B<month>, B<day>,
B<is_leap>, B<rosh>, B<part_add>, and B<part_mult>. B<rosh> returns the
absolute day corresponding to "Rosh HaShana" (New year) for a given year,
and can also be invoked as a static. B<part_add> and B<part_mult> are
useful functions for Hebrew calendrical calculations are not for much else;
if you're not familiar with the Hebrew calendar, don't worry about them.
=head2 Islamic
The traditional Muslim calendar, a purely lunar calendar with a year that
is a rough approximation of a solar year. Currently unimplemented.
=head2 Julian
The old Roman calendar, allegedly named for Julius Caesar. Purely solar,
with a month that is a rough approximation of the lunar month. Used
extensively in the Western world up to a few centuries ago, then the West
gradually switched over to the more accurate Gregorian. Now used only by
the Eastern Orthodox Church, AFAIK.
B<convert> function, since the base class handles them nicely.
First, a quick conceptual overhaul: the base class uses an "absolute day
format" (basically "Julian day format") borrowed from B<emacs>. This is
just days numbered absolutely from an extremely long time ago. It's really
easy to use, particularly if you have emacs and emacs' B<calendar mode>.
Each Date::Convert object is a reference to a hash (as in all OO perl) and
includes a special "absol" value stored under a reserved "absol" key. When
B<initialize> initializes an object, say a Gregorian date, it stores
whatever data it was given in the object and it also calculates the "absol"
equivalent of the date and stores it, too. If the user converts to another
=head1 ACKNOWLEDGEMENTS AND FURTHER READING
The basic idea of using astronomical dates as an intermediary between all
calculations comes from Dershowitz and Reingold. Reingold's code is the
basis of emacs's calendar mode. Two papers describing their work (which I
used to own, but lost! Darn.) are:
``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold,
I<Software--Practice and Experience>, Volume 20, Number 9 (September,
1990), pages 899-928. ``Calendrical Calculations, Part II: Three
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Astro.pm view on Meta::CPAN
DateTime::Astro - Functions For Astromical Calendars
=head1 DESCRIPTION
DateTime::Astro implements functions used in astronomical calendars, such
as calculation of lunar longitudea and solar longitude.
This module is best used in environments where a C compiler and the MPFR arbitrary precision math library is installed. It can fallback to using Math::BigInt, but that would pretty much render it useless because of its speed and loss of accuracy that...
=head1 DISCLAIMER
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Calendar/Chinese.pm view on Meta::CPAN
my ($rd_days, $rd_secs, $rd_nanosecs) = $dt->utc_rd_values();
=head1 DESCRIPTION
This is an implementation of the Chinese calendar as described in
"Calendrical Calculations" [1]. Please note that the following description
is the description from [1], and the author has not made attempts to verify
the correctness of statements with other sources.
The Chinese calendar described in [1] is expressed in terms of "cycle",
"cycle_year", "month", "a boolean leap_month", and "day".
Traditional Chinese years have been counted using the "Sexagecimal Cycle
of Names", which is a cycle of 60 names for each year. The names are
the combination of a "celestial stem" (tian1 gan1), with a "terrestrial branch"
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Calendar/Christian.pm view on Meta::CPAN
}
if ( $rd =~ m/ \A [0-9] /smx
and my @rda = split qr{ [^0-9]+ }smx, $rd ) {
return $class->_process_reform_date( \@rda );
}
Carp::croak( "Unknown calendar region '$rd'" );
} elsif ( ref $class && ( ref $class )->can( 'reform_date' ) ) {
return $class->reform_date();
} else {
return $class->DefaultReformDate();
}
lib/DateTime/Calendar/Christian.pm view on Meta::CPAN
if (defined $args{year}) {
$self->{date} = DateTime::Calendar::Julian->new(%args);
if ($self->{date} >= $self->{reform_date}) {
$self->{date} = DateTime->new(%args);
$self->_adjust_calendar;
}
}
return $self;
}
lib/DateTime/Calendar/Christian.pm view on Meta::CPAN
delete $arg->{reform_date} ),
}, ref $class || $class;
if ( $method ) {
$self->{date} = DateTime->$method( %{ $arg } );
$self->_adjust_calendar();
}
return $self;
}
sub _adjust_calendar {
my $self = shift;
if ($self->is_gregorian and $self->{date} < $self->{reform_date}) {
$self->{date} = DateTime::Calendar::Julian->from_object(
object => $self->{date} );
lib/DateTime/Calendar/Christian.pm view on Meta::CPAN
sub is_gregorian {
return ! $_[0]->is_julian;
}
sub calendar_name {
my ( $self ) = @_;
return $self->is_julian() ? 'Julian' : 'Gregorian';
}
sub from_epoch {
lib/DateTime/Calendar/Christian.pm view on Meta::CPAN
}
my $self = $class->new( %p );
if ($self->month != $p{month}) {
# Apparently, month N+1 does not have a day 1.
# This means that this date is removed in the calendar reform,
# and the last day of month N is the last day before the reform.
$self = $self->from_object( object => $self->{reform_date} );
}
lib/DateTime/Calendar/Christian.pm view on Meta::CPAN
# about 300, and reform_date lies at the beginning of the next year.
if ($year != $self->{reform_date}->year) {
return $self->{date}->is_leap_year;
}
# Difficult case: $year is in the year of the calendar reform
# Test if Feb 29 exists
my $d = eval { $self->new( year => $year,
month => 2,
day => 29,
) };
lib/DateTime/Calendar/Christian.pm view on Meta::CPAN
sub add_duration {
my ($self, $dur) = @_;
# According to the papal bull and the English royal decree that
# introduced the Gregorian calendar, dates should be calculated as
# if the change did not happen; this makes date math very easy in
# most cases...
# But not all.
my %deltas = $dur->deltas;
lib/DateTime/Calendar/Christian.pm view on Meta::CPAN
if ( my $days = delete $deltas{days} ) {
# Days must not be adjusted further, for sanity's sake. See RT
# 140734.
$self->{date}->add( days => $days );
$self->_adjust_calendar;
}
if ( my $months = delete $deltas{months} ) {
# This must be adjusted to avoid regression.
# TODO there are other sane things to do here.
my $start_jul = $self->is_julian;
$self->{date}->add( months => $months);
$self->_adjust_calendar;
# The intent of the following code is to implement the usual
# conversion, by adding or subtracting the Gregorian deviation
# as of the reform date. An example would be that George
# Washington was born on February 11 1732 Julian. The reform
lib/DateTime/Calendar/Christian.pm view on Meta::CPAN
# then in Gregorian for the rest of the interval, and vice versa
# for subtraction. But that would involve going back and redoing
# tha calculation.
#
# What this implementation does is to recognize that part of the
# calculation has been done in the wrong calendar, and correct
# for the number of leap year days that did (or did not) occur
# under the correct calendar.
#
# The original implementation nade this correction in all cases.
# But as Christian Carey found out, this gives incorrect (or at
# least very surprising) results when adding or subtracting
# enough days to not only cross the reform date but cross one of
lib/DateTime/Calendar/Christian.pm view on Meta::CPAN
}
if ( keys %deltas ) {
$self->{date}->add( %deltas );
$self->_adjust_calendar;
}
return $self;
}
lib/DateTime/Calendar/Christian.pm view on Meta::CPAN
}
sub set_time_zone {
my ( $self, @arg ) = @_;
$self->{date}->set_time_zone( @arg );
$self->_adjust_calendar;
return $self;
}
# This code assumes there is a month of December of the previous year.
sub day_of_year {
lib/DateTime/Calendar/Christian.pm view on Meta::CPAN
}
sub strftime {
my ( $self, @fmts ) = @_;
foreach ( @fmts ) {
s/ %\{ ( calendar_name ) \} / $self->_strftime_helper( "$1" ) /smxge;
}
return $self->{date}->strftime( @fmts );
}
sub _strftime_helper {
lib/DateTime/Calendar/Christian.pm view on Meta::CPAN
1;
__END__
=head1 NAME
DateTime::Calendar::Christian - Dates in the Christian calendar
=head1 SYNOPSIS
use DateTime::Calendar::Christian;
lib/DateTime/Calendar/Christian.pm view on Meta::CPAN
reform_date => $datetime );
=head1 DESCRIPTION
DateTime::Calendar::Christian is the implementation of the combined
Julian and Gregorian calendar.
See L<DateTime> for information about most of the methods.
=head1 BACKGROUND
The Julian calendar, introduced in Roman times, had an average year
length of 365.25 days, about 0.03 days more than the correct number. When
this difference had accumulated to about ten days, the calendar was
reformed by pope Gregory XIII, who introduced a new leap year rule. To
correct for the error that had built up over the centuries, ten days
were skipped in October 1582. In most countries, the change date was
later than that; England went Gregorian in 1752, and Russia didn't
change over until 1918.
lib/DateTime/Calendar/Christian.pm view on Meta::CPAN
specify this.
If this method is used as an instance method and no "reform_date" is
given, the "reform_date" of the returned object is the same as the one
of the object used to call this constructor. This means you can make
"date generators", that implement a calendar with a fixed reform date:
$english_calendar = DateTime::Calendar::Christian(
reform_date => DateTime->new( year => 1752,
month => 9,
day => 14 )
);
or equivalently:
$english_calendar = DateTime::Calendar::Christian(
reform_date => 'UK' );
You can use this generator to create dates with the given reform_date:
$born = $english_calendar->new( year => 1732, month => 2, day => 22 );
$died = $english_calendar->new( year => 1799, month => 12, day => 14 );
When a date is given that was skipped during a calendar reform, it is
assumed that it is a Gregorian date, which is then converted to the
corresponding Julian date. This behaviour may change in future
versions. If a date is given that can be both Julian and Gregorian, it
will be considered Julian. This is a bug.
=item * from_epoch, from_object, from_day_of_year, last_day_of_month
These methods accept an additional "reform_date" argument. Note that the
epoch is defined for most (all?) systems as a date in the Gregorian
calendar. B<But> this module will still represent it as a Julian date if
the epoch gives a date before the reform date.
=item * reform_date
Returns the date of the calendar reform, as a DateTime object.
=item * is_julian, is_gregorian
Return true or false indicating whether the datetime object is in a
specific calendar.
=item * calendar_name
Return C<'Julian'> or C<'Gregorian'>, depending on the value returned by
C<is_julian()>.
=item * is_leap_year
This method returns a true or false indicating whether or not the
datetime object is in a leap year. If the object is in the year of the
date reform, this method indicates whether there is a leap day in that
year, irrespective of whether the datetime object is in the same
calendar as the possible leap day.
=item * days_in_year
Returns the number of days in the year. Is equal to 365 or 366, except
for the year(s) of the calendar reform.
=item * day_of_year, day_of_year_0
Returns the day of the year, either one-based or zero-based depending on
the actual method called. In the reform year this is the actual number
lib/DateTime/Calendar/Christian.pm view on Meta::CPAN
When months and/or years are involved, the result is modified from a
straight I<rata die> calculation to add or subtract the number of days
skipped by the reform. Without this modification, George Washington's
birthday of February 11 Julian would drift forward in the Gregorian
calendar as the difference between the two calendars increased. With
this modification, it is February 22 Gregorian regardless of the actual
days difference between the two calendars.
B<Note> that in versions C<0.12> and earlier this modification was
applied to B<all> durations. This produced anomalous (i.e. wrong)
results when adding or subtracting large numbers of days.
lib/DateTime/Calendar/Christian.pm view on Meta::CPAN
=item * strftime
This override allows selected methods of this class (i.e. not inherited
from DateTime) to be used in the C<'%{method_name}'> construction in
templates. The only method allowed at the moment is C<calendar_name>.
=item * gregorian_deviation( [$datetime] )
This method returns the difference in days between the Gregorian and the
Julian calendar. If the parameter $datetime is given, it will be used to
calculate the result; in this case this method can be used as a class
method.
This deviation increments on March 1 (Julian) of any year which is a
leap year in the Julian calendar but not the Gregorian calendar.
=item * julian_deviation( [$datetime] )
This method was added in version 0.13.
This method returns the difference in days between the Gregorian and the
Julian calendar. If the parameter $datetime is given, it will be used to
calculate the result; in this case this method can be used as a class
method.
This deviation increments on March 1 (Gregorian) of any year which is a
leap year in the Julian calendar but not the Gregorian calendar.
=item * DefaultReformDate
This static method returns a L<DateTime|DateTime> object representing
the default reform date. If called with an argument, the argument
lib/DateTime/Calendar/Christian.pm view on Meta::CPAN
=back
=head1 SPECIFYING REFORM DATE
The reform date represents the first date the Gregorian calendar came
into use. It can be specified a number of different ways:
=over
=item * A DateTime object, or an object that can be converted into one.
lib/DateTime/Calendar/Christian.pm view on Meta::CPAN
=head1 BUGS
=over
=item * There are problems with calendars switch to Gregorian before 200 AD or after about 4000 AD. Before 200 AD, this switch leads to duplication of dates. After about 4000 AD, there could be entire missing months. (The module can handle dates befo...
=item * There may be functions that give the wrong results for the year of the calendar reform. The function C<truncate()> is a known problem, and C<today()> may be a problem. If you find any more problems, please let me know.
=back
=head1 SUPPORT
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Calendar/Coptic.pm view on Meta::CPAN
#
# calscale and toGregorian and are methods I recommend every non-Gregorian
# based DateTime package provide to identify itself and to convert the
# calendar system it handles into a normalized form.
#
sub calscale
{
"coptic";
}
lib/DateTime/Calendar/Coptic.pm view on Meta::CPAN
# instantiate with a Gregorian date, date will be converted.
#
$coptic = new DateTime::Calendar::Coptic ( day => 5, month => 4, year => 2003, calscale => 'gregorian' );
#
# get a DateTime object in the Gregorian calendar system
#
my $grego = $coptic->toGregorian;
=head1 DESCRIPTION
The DateTime::Calendar::Coptic module provides methods for accessing date information
in the Coptic calendar system. The module will also convert dates to
and from the Gregorian system.
=head1 CREDITS
L<http://www.copticchurch.net/easter.html>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Calendar/Discordian.pm view on Meta::CPAN
use DateTime::Calendar::Discordian;
=head1 ABSTRACT
A module that implements the Discordian calendar made popular(?) in the
"Illuminatus!" trilogy by Robert Shea and Robert Anton Wilson and by the
Church of the SubGenius.
=cut
lib/DateTime/Calendar/Discordian.pm view on Meta::CPAN
Support for this module is provided via the datetime@perl.org email list. See
L<lists.perl.org|http://lists.perl.org/> for more details.
Please submit bugs to the L<CPAN RT system|http://rt.cpan.org/NoAuth/ReportBug.html?Queue=datetime-Calendar-Discordian>
or via email at bug-datetime-calendar-discordian@rt.cpan.org.
You can also look for information at:
=over 4
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Calendar/FrenchRevolutionary.pm view on Meta::CPAN
# -*- encoding: utf-8; indent-tabs-mode: nil -*-
#
# Perl DateTime extension for converting to/from the French Revolutionary calendar
# Copyright (c) 2003, 2004, 2010, 2011, 2012, 2014, 2016, 2019, 2021 Jean Forget. All rights reserved.
#
# See the license in the embedded documentation below.
#
lib/DateTime/Calendar/FrenchRevolutionary.pm view on Meta::CPAN
}
sub set_time_zone { } # do nothing, only 'floating' allowed
# Internal functions
use constant REV_BEGINNING => 654415; # RD value for 1 Vendémiaire I in the Revolutionary calendar
use constant NORMAL_YEAR => 365;
use constant LEAP_YEAR => 366;
use constant FOUR_YEARS => 4 * NORMAL_YEAR + 1; # one leap year every four years
use constant CENTURY => 25 * FOUR_YEARS - 1; # centuries aren't leap years...
use constant FOUR_CENTURIES => 4 * CENTURY + 1; # ...except every four centuries that are.
use constant FOUR_MILLENIA => 10 * FOUR_CENTURIES - 1; # ...except every four millenia that are not.
# number of days between the start of the revolutionary calendar, and the
# beginning of year n - 1 as long as the equinox rule is in effect
my @YEARS_BEGINS= (0, 365, 730, 1096, 1461, 1826, 2191, 2557, 2922, 3287, 3652,
4018, 4383, 4748, 5113, 5479, 5844);
sub _is_leap_year {
my ($self, $year) = @_;
lib/DateTime/Calendar/FrenchRevolutionary.pm view on Meta::CPAN
$doy -= $x * FOUR_YEARS;
$x = int ($doy / NORMAL_YEAR);
# The integer division above divides the 4-year period, 1461 days,
# into 5 parts: 365, 365, 365, 365 and 1. This mathematically sound operation
# is wrong with respect to the calendar, which needs to divide
# into 4 parts: 365, 365, 365 and 366. Therefore the adjustment below.
$x = 3 if $x == 4; # last day of the 4-year period
$y += $x;
$doy -= $x * NORMAL_YEAR;
lib/DateTime/Calendar/FrenchRevolutionary.pm view on Meta::CPAN
For your information, the French word for a ten-year period is
I<décennie>.
=head2 Description
The Revolutionary calendar was in use in France from 24 November 1793
(4 Frimaire II) to 31 December 1805 (10 Nivôse XIV). An attempt to
apply the decimal rule (the basis of the metric system) to the
calendar. Therefore, the week disappeared, replaced by the décade. In
addition, all months have exactly 3 décades, no more, no less.
At first, the year was beginning on the equinox of autumn, for two
reasons. First, the republic had been established on 22 September
1792, which happened to be the equinox, and second, the equinox was
the symbol of equality, the day and the night lasting exactly 12 hours
each. It was therefore in tune with the republic's motto "Liberty,
Equality, Fraternity". But it was not practical, so Romme proposed a
leap year rule similar to the Gregorian calendar rule.
In his book I<The French Revolution>, the XIXth century writer Thomas
Carlyle proposes these translations for the month names:
=over 4
lib/DateTime/Calendar/FrenchRevolutionary.pm view on Meta::CPAN
= 10 hours, 1 hour = 100 minutes and 1 minute = 100 seconds. But this
reform was put on hold after two years or so and it never reappeared.
Other reforms to decimalize the time has been proposed during the last
part of the XIXth Century, but these reforms were not applied too.
And they are irrelevant for this French Revolutionary calendar module.
=head1 METHODS
Since the week has been replaced by the décade, the corresponding
method names still are C<decade_number>, C<day_of_decade>, etc.
lib/DateTime/Calendar/FrenchRevolutionary.pm view on Meta::CPAN
=back
=item * from_epoch( epoch => $epoch )
Creates a date object from a timestamp value. This timestamp is the
number of seconds since the computer epoch, not the calendar epoch.
=item * now( )
Creates a date object that corresponds to the precise instant the
method is called.
=item * from_object( object => $object, ... )
Creates a date object by converting another object from the DateTime
suite. The preferred way for calendar to calendar conversion.
=item * last_day_of_month( ... )
Same as C<new>, except that the C<day> parameter is forbidden and is
automatically set to the end of the month. If the C<month> parameter
lib/DateTime/Calendar/FrenchRevolutionary.pm view on Meta::CPAN
separator (C<:> by default).
=item * iso8601
Returns the date and time is a format similar to what ISO-8601 has
specified for the Gregorian calendar.
=item * is_leap_year
Returns a true value if the year is a leap year, false else.
lib/DateTime/Calendar/FrenchRevolutionary.pm view on Meta::CPAN
this is done for compatibility with DateTime's C<week> method.
=item * utc_rd_values
Returns the current UTC Rata Die days, seconds and nanoseconds as a
3-element list. This exists primarily to allow other calendar modules
to create objects based on the values provided by this object.
=item * jd, mjd
These return the Julian Day and Modified Julian Day, respectively.
lib/DateTime/Calendar/FrenchRevolutionary.pm view on Meta::CPAN
=item * on_date
Gives a few historical events that took place on the same date
(day+month, irrespective of the year). These events occur during the
period of use of the calendar, that is, no later than Gregorian year
1805. The related events either were located in France, or were
battles in which a French army was involved.
This method accepts one optional argument, the language. For the
moment, only "en" for English and "fr" for French are available. If
lib/DateTime/Calendar/FrenchRevolutionary.pm view on Meta::CPAN
Equivalent to %Y-%m-%d (the ISO 8601 date format)
=item * %g
Strictly similar to %y, since I<décades> are always aligned with the
beginning of the year in this calendar.
=item * %G
Strictly similar to %Y, since I<décades> are always aligned with the
beginning of the year in this calendar.
=item * %h
Equivalent to %b.
lib/DateTime/Calendar/FrenchRevolutionary.pm view on Meta::CPAN
The year as a lowercase Roman number.
=item * %EY
The year as a uppercase Roman number, which is the traditional way to
write years when using the French Revolutionary calendar.
=item * %z
The time-zone as hour offset from UTC. Required to emit
RFC822-conformant dates (using "%a, %d %b %Y %H:%M:%S %z"). Since the
module does not support time zones, this gives silly results and you
cannot be RFC822-conformant. Anyway, RFC822 requires the Gregorian
calendar, doesn't it?
=item * %Z
The time zone or name or abbreviation, should the module have
supported them.
lib/DateTime/Calendar/FrenchRevolutionary.pm view on Meta::CPAN
=head2 Time Zones
Only the I<floating> time zone is supported. Time zones were created
in the late XIXth century, at a time when fast communication
(railroads) and instant communication (electric telegraph) made it
necessary. But at this time, the French Revolutionary calendar was no
longer in use.
=head2 Leap Seconds
They are not supported.
lib/DateTime/Calendar/FrenchRevolutionary.pm view on Meta::CPAN
(day of reason) in others.
In addition, the sources have several slight differences between them.
All of them obviously include some typos. [Annexe] is chosen as the
reference since it is the definitive legislative text that officially
defines names of days in the French revolutionary calendar. This text
introduces amendments to the original calendar set up by Fabre
d'Ãglantine in [Fabre], and gives in annex the amended calendar. When
there is a difference between the amended calendar and [Fabre] with
amendments (yes it can happen!), [Fabre] version prevails. Obvious
typos in [Annexe] (yes it can happen!) are preserved, with the
exception of accented letters because they are fuzzy rendered in
original prints, or cannot be printed at all at that time on letters
in uppercase.
lib/DateTime/Calendar/FrenchRevolutionary.pm view on Meta::CPAN
L<Date::Converter>
=head2 Other Software
F<calendar/cal-french.el> in emacs-21.2 or later or xemacs 21.1.8,
forked in L<https://github.com/jforget/emacs-lisp-cal-french>
=head2 Books
Quid 2001, M and D Frémy, publ. Robert Laffont
lib/DateTime/Calendar/FrenchRevolutionary.pm view on Meta::CPAN
=head2 Internet
L<https://github.com/houseabsolute/DateTime.pm/wiki>
L<http://www.faqs.org/faqs/calendars/faq/part3/>
L<https://zapatopi.net/metrictime/>
L<http://datetime.mongueurs.net/>
view all matches for this distribution
view release on metacpan or search on metacpan
1;
__END__
=head1 NAME
DateTime::Calendar::Hebrew - Dates in the Hebrew calendar
=head1 SYNOPSIS
use DateTime::Calendar::Hebrew;
month => 10,
day => 4 );
=head1 DESCRIPTION
C<DateTime::Calendar::Hebrew> is the implementation of the Hebrew calendar.
Read on for more details on the Hebrew calendar.
=head1 THE HEBREW (JEWISH) CALENDAR
The Hebrew/Jewish calendar is a Luni-Solar calendar. Torah Law mandates that months are Lunar. The first day of a month coincides with the new moon in Jerusalem. (In ancient times, this was determined by witnesses. Read the books in the bibliography ...
The Hebrew Calendar uses a leap-month to regulate itself to the solar seasons. There are 12 months in a regular year. Months can be 29 or 30 days long. 2 of the months (Cheshvan & Kislev) change between having 29 & 30 days, depending on the year. In ...
Now a quick note about the numbering of the months. Most people expect a new year to start with month #1. However, the Hebrew calendar has more than one new year. The year number changes in the (Northern Hemisphere) Autumn with Tishrei (month #7), bu...
Tishrei is the month in which you find the High-Holy-Days - 'Rosh HaShana' & 'Yom Kippur'.
Nissan, the Spring-new-year, commemorates the Exodus of the Ancient Israelites from Egypt. The Torah refers to months only by number, beginning with Nissan, e.g. giving the date of Yom Kippur in 'the seventh month'.
=back
I<** A NOTE ABOUT SPELLING **>
If you speak Hebrew, you may take issue with my spelling of Hebrew words. I'm sorry, I used the spelling closest to the way I pronounce it. You could call it "Brooklyn-Ashkenaz-Pronunciation", if you like.
Back to the calendar. A cycle of Hebrew years takes 19 years and is called a Machzor. In that cycle, years 3, 6, 8, 11, 14, 17 & 19 are leap years.
Days (and holidays) begin at sunset, see below for more info.
The calculations for the start and length of the year are based on a number of factors, including rules about what holidays can't be on what days of the week, and things like that. For more detailed information about the Hebrew Calendar and Hebrew-Ca...
This book is great. Besides for a complete Jewish Calendar from 1900 to 2100, it contains a 22 page discourse on the Jewish Calendar - history, calculation method, religious observances - the works.
B<Understanding the Jewish Calendar by Rabbi Nathan Bushwick. Moznaim Publishing Corporation. ISBN 0-94011-817-3>
Another excellent book. Explains the calendar, lunation cycles, torah portions and more. This has more Astronomy than any of the others.
B<Calendrical Calculations by Edward Reingold & Nachum Dershowitz. Cambridge University Press. ISBN 0-521-77167-6 or 0-521-77752-6>
This book focuses on the math of calendar conversions. I use the first edition, which is full of examples in LISP. The second edition is supposed to include examples in other languages. It covers many different calendars - not just Hebrew. See their...
There are other books, but those are the ones I used most extensively in my Perl coding.
=head1 METHODS
minute/second : 0 to 59
nanosecond : 0 to 999,999,999
C<Date::Calendar::Hebrew> doesn't support timezones. It uses the floating timezone.
The days on the Hebrew calendar begin at sunset. If you want to know the Hebrew
date, accurate with regard to local sunset, see the SUNSET section below.
=item * from_object(object => $object)
This class method can be used to construct a new object from
any object that implements the C<utc_rd_values()> method. All
C<DateTime::Calendar> modules must implement this method in order to
provide cross-calendar compatibility.
=item * set(...)
$dt->set(
year => 5782,
Values are checked for validity just as they are in C<new()>.
=item * utc_rd_values
Returns the current UTC Rata Die days and seconds as a three element
list. This exists primarily to allow other calendar modules to create
objects based on the values provided by this object. We don't support
timezones, so this is actually the local RD.
=item * utc_rd_as_seconds
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Calendar/Hijri.pm view on Meta::CPAN
1;
__END__
=head1 NAME
DateTime::Calendar::Hijri - Dates in the Hijri (Islamic) calendar
=head1 SYNOPSIS
use DateTime::Calendar::Hijri;
$dt = DateTime::Calendar::Hijri->new( year => 1424,
lib/DateTime/Calendar/Hijri.pm view on Meta::CPAN
object => $datetime_obj
);
=head1 DESCRIPTION
The Hijri calendar is based on the flight of Mohammed from Mecca to
Medina in the year 622 in the Gregorian calendar. This was taken as the
start of the new calendar, which is still used in a number of Islamic
countries.
Like the Gregorian calendar, the Hijri year consists of 12 months. The
start of each month is determined by the observation of the young moon.
This means that the Hijri calendar is not predictable: it is not known
beforehand when a new month will start. Several algorithms have been
written to predict the starting days of the month, and one of them is
used by this module. The calculated dates can therefore be one or two
days off the actual dates.
lib/DateTime/Calendar/Hijri.pm view on Meta::CPAN
Creates a Hijri date from another datetime compatible object.
=item * utc_rd_values
Returns the rata die count of days. This is used to convert from a Hijri
date to another calendar
=head1 BUGS
=item *
The dates are sometimes wrong by one or two days when you convert to or
from other calendars. This can't be helped, as the Hijri calendar is
based on observations, not on an algorithm.
=item *
The functionality offered by this module is rather minimal compared to
other calendar modules within the DateTime project. This is because I am
not very familiar with the Hijri calendar, and I feel I am unable to do
it justice. If you can, and if you are willing to put some time into
improving this module, I would be glad to hand over the maintainership.
Mail me!
=back
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Calendar/Japanese.pm view on Meta::CPAN
=head1 DESCRIPTION
This module implements the traditional Japanese Calendar, which was used
from circa 692 A.D. to 1867 A.D. The traditional Japanese Calendar is a
I<lunisolar calendar> based on the Chinese Calendar, and therefore
this module may *not* be used for handling or formatting modern Japanese
calendars which are Gregorian Calendars with a twist.
Please use DateTime::Format::Japanese for that purpose.
On top of the lunisolar calendar, this module implements a simple time
system used in the Edo period, which is a type of temporal hour system,
based on sunrise and sunset.
=head1 CAVEATS/DISCLAIMERS
lib/DateTime/Calendar/Japanese.pm view on Meta::CPAN
Help is much appreciated to rectify this :)
=head2 CALENDAR "VERSION"
Note that for each of these calendars there exist numerous different
versions/revisions. The Japanese Calendar has at least 6 different
revisions.
The Japanese Calendar that is implemented here uses the algorithm described
in the book "Calendrical Computations" [1], which presumably describes the
latest incarnation of these calendars.
=head2 ERA DISCREPANCIES FROM MODERN JAPANESE DATES
Even though this module can handle modern dates, note that this module
creates dates in the *traditional* calendar, NOT the modern gregorian
calendar used in Japane since the Meiji era. Yet, we must honor the gregorian
date in which an era started or ended. This means that the era year
calculations could be off from what you'd expect on a modern calendar.
For example, the Heisei era starts on 08 Jan 1989 (Gregorian), so in a
modern calendar you would expect the rest of year 1989 to be Heisei 1.
However, the Chinese New Year happens to fall on 06 Feb 1989. Thus
this module would see that and increment the era year by one on that
date.
If you want to express modern Japanese calendars, you will need to use
L<DateTime::Format::Japanese> module on the vanilla DateTime object.
(As of this writing DateTime::Format::Japanese is in alpha release. Use
at your own peril)
=head2 TIME COMPONENTS
lib/DateTime/Calendar/Japanese.pm view on Meta::CPAN
Sets DateTime components.
=head2 utc_rd_values
Returns the current UTC Rata Die days, seconds, and nanoseconds as a three
element list. This exists primarily to allow other calendar modules to create
objects based on the values provided by this object.
=head2 cycle
Returns the current cycle. See L<DateTime::Calendar::Chinese>
lib/DateTime/Calendar/Japanese.pm view on Meta::CPAN
Returns the current cycle_year. See L<DateTime::Calendar::Chinese>
=head2 era
Returns the DateTime::Calendar::Japanese::Era object associated with this
calendar.
=head2 era_name
Returns the name (id) of the DateTime::Calendar::Japanese::Era object
associated with this calendar.
=head2 era_year
Returns the number of years in the current era, as calculated by the
traditional lunisolar calendar. Note that calculations will be different
from those based on the modern calendar, as the date of New Year (which is
when era years are incremented) differ from modern calendars. For example,
based on the traditional calendar, SHOUWA3 (1926 - 1989) had only 63 years,
not 64. See L<CAVEATS|/ERA DISCREPANCIES FROM MODERN JAPANESE DATES>
=head2 hour
Returns the hour, based on the traditional Japanese time system. The
lib/DateTime/Calendar/Japanese.pm view on Meta::CPAN
[1] Edward M. Reingold, Nachum Dershowitz
"Calendrical Calculations (Millenium Edition)", 2nd ed.
Cambridge University Press, Cambridge, UK 2002
[2] http://homepage2.nifty.com/o-tajima/rekidaso/calendar.htm
[3] http://www.tanomi.com/shop/items/wa_watch/index2.html
[4] http://www.geocities.co.jp/Playtown/6757/edojikan01.html
[5] http://www.valley.ne.jp/~ariakehs/Wadokei/hours_system.html
=head1 SEE ALSO
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Calendar/Julian.pm view on Meta::CPAN
my @start_of_month = (0, 31, 61, 92, 122, 153, 184, 214, 245, 275, 306, 337);
# Julian dates are formatted in exactly the same way as Gregorian dates,
# so we use most of the DateTime methods.
# This is the difference between Julian and Gregorian calendar:
sub _is_leap_year {
my (undef, $year) = @_; # Invocant unused
return ($year % 4 == 0);
}
lib/DateTime/Calendar/Julian.pm view on Meta::CPAN
}
return $y, $m, $d;
}
}
sub calendar_name {
return 'Julian';
}
sub epoch {
my $self = shift;
lib/DateTime/Calendar/Julian.pm view on Meta::CPAN
__END__
=head1 NAME
DateTime::Calendar::Julian - Dates in the Julian calendar
=head1 SYNOPSIS
use DateTime::Calendar::Julian;
lib/DateTime/Calendar/Julian.pm view on Meta::CPAN
This module implements one additional method besides the ones from
DateTime, and changes the output of one other method.
=over 4
=item * calendar_name
Returns C<'Julian'>.
=item * gregorian_deviation
Returns the difference in days between the Gregorian and the Julian
calendar.
=item * datetime
print $dt->datetime( $sep ), "\n";
lib/DateTime/Calendar/Julian.pm view on Meta::CPAN
B<Note> that as of version C<0.106_01>, methods related to quarters
should work.
=head1 BACKGROUND
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.
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.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Calendar/Liturgical/Christian.pm view on Meta::CPAN
my $advent_sunday = advent_sunday($y);
if ($easter_point>-47 && $easter_point<0) {
$season = 'Lent';
$weekno = ($easter_point+50)/7;
# FIXME: The ECUSA calendar seems to indicate that Easter Eve ends
# Lent *and* begins the Easter season. I'm not sure how. Maybe it's
# in both? Maybe the daytime is in Lent and the night is in Easter?
} elsif ($easter_point>=0 && $easter_point<=49) {
# yes, this is correct: Pentecost itself is in Easter season;
# Pentecost season actually begins on the day after Pentecost.
lib/DateTime/Calendar/Liturgical/Christian.pm view on Meta::CPAN
__END__
=head1 NAME
DateTime::Calendar::Liturgical::Christian - calendar of the church year
=head1 SYNOPSIS
$dtclc = DateTime::Calendar::Liturgical::Christian->new(
day=>4,
lib/DateTime/Calendar/Liturgical/Christian.pm view on Meta::CPAN
print $dtclc->colour(); # 'red'
=head1 DESCRIPTION
This module will return the name, season, week number and liturgical colour
for any day in the Gregorian calendar. It will eventually support the
liturgical calendars of several churches (hopefully at least Anglican,
Lutheran, Orthodox and Roman Catholic). At present it only knows the calendar
for the Episcopal Church of the USA.
If you find bugs, or if you have information on the calendar of another
liturgical church, please do let me know (thomas at thurman dot org dot uk).
=head1 OVERVIEW
Some churches use a special church calendar. Days and seasons within the year
may be either "fasts" (solemn times) or "feasts" (joyful times). The year is
structured around the greatest feast in the calendar, the festival of the
Resurrection of Jesus, known as Easter, and the second greatest feast, the
festival of the Nativity of Jesus, known as Christmas. Before Christmas and
Easter there are solemn fast seasons known as Advent and Lent respectively.
After Christmas comes the feast of Epiphany, and after Easter comes the feast
of Pentecost. These days have the adjacent seasons named after them.
lib/DateTime/Calendar/Liturgical/Christian.pm view on Meta::CPAN
=item new ([ OPTIONS ])
This constructs a DateTime::Calendar::Liturgical::Christian object. It takes
a series of named options. Possible options are:
B<year> (required). The year AD in the Gregorian calendar.
B<month> (required). The month number in the Gregorian calendar. 1 is January.
B<day> (required). The day of the month.
B<tradition> (recommended). The tradition to use. Currently only C<ECUSA> is known.
view all matches for this distribution
view release on metacpan or search on metacpan
DateTime::Calendar::Mayan
========================
This is a companion module to DateTime.pm. It implements the Mayan Long Count
calendar.
INSTALLATION
To install this module type the following:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Calendar/Pataphysical.pm view on Meta::CPAN
sub _rd2ymd {
my ($class, $rd) = @_;
# Algorithm similar to the one on
# http://home.capecod.net/~pbaum/date/injdalg2.htm
# for the gregorian calendar
# Number of days since 1 Pedale 127 (day after first extra leap day) =
# 24-02-2000
$rd -= 730173;
lib/DateTime/Calendar/Pataphysical.pm view on Meta::CPAN
=encoding utf-8
=head1 NAME
DateTime::Calendar::Pataphysical - Dates in the Pataphysical calendar
=head1 VERSION
version 0.07
lib/DateTime/Calendar/Pataphysical.pm view on Meta::CPAN
day => 4 );
=head1 DESCRIPTION
DateTime::Calendar::Pataphysical is the implementation of the
Pataphysical calendar. Each year in this calendar contains 13 months of
29 days. This regularity makes this a convenient alternative for the
irregular Gregorian calendar.
This module is designed to be easy to use in combination with
L<DateTime>. Most of its methods correspond to a L<DateTime> method of the
same name.
lib/DateTime/Calendar/Pataphysical.pm view on Meta::CPAN
This class method accepts parameters for each date and time component:
C<year>, C<month>, C<day>. Additionally, it accepts a C<locale>
parameter.
The C<rd_secs> parameter is also accepted. This parameter is only useful
in conversions to other calendars; this calendar does not use its value.
=head2 from_epoch
my $dt = DateTime::Calendar::Pataphysical->from_epoch( epoch => $epoch, ... );
lib/DateTime/Calendar/Pataphysical.pm view on Meta::CPAN
my $dt = DateTime::Calendar::Pataphysical->from_object( object => $object, ... );
This class method can be used to construct a new object from
any object that implements the L<utc_rd_values> method. All
L<DateTime::Calendar> modules must implement this method in order to
provide cross-calendar compatibility. This method accepts a
C<locale> parameter.
The time part of C<$object> is stored, and will only be used if the created
object is converted to another calendar. Only the date part of C<$object>
is used to calculate the pataphysical date. This calculation is based on
the local time and date of C<$object>.
=head2 last_day_of_month
lib/DateTime/Calendar/Pataphysical.pm view on Meta::CPAN
=head2 week
my ( $week_year, $week_number ) = $dt->week;
Returns information about the calendar week which contains this
L<DateTime> object. The values returned by this method are also available
separately through the L<week_year> and L<week_number> methods.
=head2 week_year
Returns the year of the week. In the Pataphysical calendar, this is
equal to the year of the date, as all weeks fall in one year only.
=head2 week_number
Returns the week of the year, from C<1 .. 53>.
lib/DateTime/Calendar/Pataphysical.pm view on Meta::CPAN
C<undef> for these dates.
=head2 utc_rd_values
Returns the current UTC Rata Die days and seconds as a two element
list. This exists primarily to allow other calendar modules to create
objects based on the values provided by this object.
=head2 utc_rd_as_seconds
Returns the current UTC Rata Die days and seconds purely as seconds.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Calendar/WarwickUniversity.pm view on Meta::CPAN
package DateTime::Calendar::WarwickUniversity;
=head1 NAME
DateTime::Calendar::WarwickUniversity - Warwick University academic calendar
=head1 SYNOPSIS
use DateTime::Calendar::WarwickUniversity;
lib/DateTime/Calendar/WarwickUniversity.pm view on Meta::CPAN
print join(', ', $dt->term_and_week);
=head1 DESCRIPTION
DateTime::Calendar::WarwickUniversity is used for working with the
academic calendar in use at the University of Warwick.
=cut
use 5.008004;
use strict;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Duration/Lite.pm view on Meta::CPAN
sub is_limit_mode { $_[0]->end_of_month eq 'l' ? 1 : 0 }
sub is_preserve_mode { $_[0]->end_of_month eq 'p' ? 1 : 0 }
sub end_of_month_mode { $_[0]->end_of_month }
sub calendar_duration {
my $self = shift;
return ( ref $self )
->new( map { $_ => $self->$_ } qw( _months _days _end_of_month ) );
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Event/Cron/Quartz.pm view on Meta::CPAN
# move ahead one second, since we're computing the time *after* the
# given time
$after_time->add( seconds => 1 );
# operable calendar
my $cl = $after_time->clone;
my $got_one = 0;
# loop until we've computed the next time, or we've past the endTime
lib/DateTime/Event/Cron/Quartz.pm view on Meta::CPAN
$hr++;
}
if ( $min != $t ) {
$cl->set( second => 0, minute => $min );
$this->set_calendar_hour( $cl, $hr );
next ITER;
}
$cl->set( minute => $min );
}
lib/DateTime/Event/Cron/Quartz.pm view on Meta::CPAN
if ( $hr != $t ) {
$cl->add( days => $day - $cl->day );
$cl->set( second => 0, minute => 0 );
$this->set_calendar_hour( $cl, $hr );
next ITER;
}
$cl->set( hour => $hr );
}
lib/DateTime/Event/Cron/Quartz.pm view on Meta::CPAN
} # while( !done )
return $cl;
}
#* Advance the calendar to the particular hour paying particular attention
#* to daylight saving problems.
#*
#* @param cal
#* @param hour
sub set_calendar_hour {
my $this = shift;
my ( $cal, $hour ) = @_;
my $delta = 0;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Event/Easter.pm view on Meta::CPAN
March 21st. Easter Sunday is never on the full moon. Thus the earliest
Easter can be is March 22nd.
In the orthodox world, although they now use the Gregorian Calendar
rather than the Julian, they still take the first full moon on or after the
Julian March 21st. As the Julian calendar is slowly getting further and
further out of sync with the Gregorian, the first full moon after this
date can be a completely different one than for the western Easter. This
is why the Orthodox churches celebrate Easter later than western
churches.
lib/DateTime/Event/Easter.pm view on Meta::CPAN
=item * western_epact($year)
In the Gregorian comput, the epact is the age of the ecclesiastical
Moon on the 1st January of the given year. The C<western> part of the
subroutine name accounts for the fact that Gregorian and Julian
calendars do not use the same formula.
The epact is a 0..29 number. The "0" value is shown as "*" in some
sources. This subroutine does not convert "0" to "*", the result is
always a pure number.
lib/DateTime/Event/Easter.pm view on Meta::CPAN
=item * eastern_epact($year)
In the Julian comput, the epact is the age of the ecclesiastical Moon
on 22nd March. The C<eastern> part of the subroutine name accounts for
the fact that Gregorian and Julian calendars do not use the same
formula.
The epact is a 0..29 number. The "0" value is shown as "*" in some
sources. This subroutine does not convert "0" to "*", the result is
always a pure number. There is no other special case, for 25 as for
lib/DateTime/Event/Easter.pm view on Meta::CPAN
=over 4
=item * L<https://github.com/houseabsolute/DateTime.pm/wiki> - The official wiki
of the DateTime project
=item * L<https://www.tondering.dk/claus/calendar.html> - Claus Tøndering's
calendar FAQ, especially the page L<https://www.tondering.dk/claus/cal/easter.php>.
=item * I<Calendrical Calculations> (Third or Fourth Edition) by Nachum Dershowitz and
Edward M. Reingold, Cambridge University Press, see
L<http://www.calendarists.com>
or L<https://www.cambridge.org/us/academic/subjects/computer-science/computing-general-interest/calendrical-calculations-ultimate-edition-4th-edition?format=PB&isbn=9781107683167>,
ISBN 978-0-521-70238-6 for the third edition.
=item * I<La saga des calendriers>, by Jean Lefort, published by I<Belin> (I<Pour la Science>), ISBN 2-90929-003-5
See L<https://www.belin-editeur.com/la-saga-des-calendriers>
lib/DateTime/Event/Easter.pm view on Meta::CPAN
Much help from the DateTime mailing list, especially from:
B<Eugene van der Pijll> - who pointed out flaws causing errors on
gregorian years with no eastern easter (like 35000) and who came up with
a patch to make the module accept any calendar's DateTime object
B<Dave Rolsky> - who picked nits, designed DateTime itself and leads the project
B<Martin Hasch> - who pointed out the posibility of memory leak with an early beta
view all matches for this distribution
view release on metacpan or search on metacpan
TODO list for Perl module DateTime-Event-ICal
* high frequency FREQ can be optimized by precomputing larger steps of INTERVAL
* include this in docs:
http://www.w3.org/2001/sw/Europe/200210/calendar/vocab_usecases.html
http://www.imc.org/ietf-calendar/mail-archive/msg00623.html
* optimize yealy/monthly + interval + byday
- uses intersection with "all days"
* "byday -2 friday"
view all matches for this distribution
view release on metacpan or search on metacpan
The Functions (code, comments, and definitions) contained on this compact disk (the "Program") were written by Edward M. Reingold and Nachum Dershowitz (the "Authors"), who retain all rights to them except as granted in the License and subject to the...
The Authors' public service intent is more liberal than suggested by the License below, as are their licensing policies for otherwise nonallowed uses such as--without limitation--those in commercial, web-site, and large-scale academic contexts. Pleas...
http://www.calendarists.com
for all uses not authorized below; in case there is cause for doubt about whether a use you contemplate is authorized, please contact the Authors (email: reingold@iit.edu) . For commercial licensing information, contact the first author at the Depart...
1. LICENSE. The Authors grant you a license for personal use only. This means that for strictly personal use you may copy and use the code, and keep a backup or archival copy also. Any other uses, including without limitation, allowing the code or it...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Event/NameDay.pm view on Meta::CPAN
# - Find our section
my $nameday_info =
$self->_init_nameday_country(namedays => \%namedays,
country => $country);
# - Convert to the Julian calendar
my $adj_dt = DateTime::Calendar::Christian->from_object
(object => $p{date},
reform_date => $nameday_info->{reform_date},
%{ $self->date_args() },
);
lib/DateTime/Event/NameDay.pm view on Meta::CPAN
C<DateTime::Set> object that can be used to work out what dates are
for the given name.
Please note that the calculations are done using the
C<DateTime::Calendar::Christian> module to deal with dates that fall
before the calendar reforms.
=head1 USAGE
TODO
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Event/WarwickUniversity.pm view on Meta::CPAN
package DateTime::Event::WarwickUniversity;
=head1 NAME
DateTime::Event::WarwickUniversity - Warwick University academic calendar events
=head1 SYNOPSIS
use DateTime::Event::WarwickUniversity;
lib/DateTime/Event/WarwickUniversity.pm view on Meta::CPAN
# 2004-09-28
my $dt_ac = DateTime::Event::Warwick->new_year_for_academic_year($dt);
=head1 DESCRIPTION
DateTime::Event::WarwickUniversity is used to work with the academic calendar
of the University of Warwick.
=cut
use 5.008004;
lib/DateTime/Event/WarwickUniversity.pm view on Meta::CPAN
use Scalar::Util qw/blessed/;
our $VERSION = '0.05';
# http://web.archive.org/web/19980114233111/warwick.ac.uk/info/dates.html
# http://web.archive.org/web/20001101110549/www.warwick.ac.uk/info/calendar/section1/1.01.html
# http://www2.warwick.ac.uk/insite/info/gov/calendar/section1/termdates/
# http://www2.warwick.ac.uk/services/gov/calendar/section1/termdates
my %new_year = (
1996 => ['09', '30'],
1997 => ['09', '29'],
1998 => ['10', '05'],
lib/DateTime/Event/WarwickUniversity.pm view on Meta::CPAN
=head2 new_year_for_gregorian_year
Takes as argument a single L<DateTime> object.
Returns a L<DateTime> object representing the first day of the academic
calendar that begins in the same Gregorian year as the input.
=cut
sub new_year_for_gregorian_year {
my ($class, $dt) = @_;
lib/DateTime/Event/WarwickUniversity.pm view on Meta::CPAN
}
# _new_year_dt_from_gregorian_year
#
# Not part of public API. Takes a string containing a year, and returns a
# DateTime object representing the first day of the academic calendar that
# began in that Gregorian year.
sub _new_year_dt_from_gregorian_year {
my $year = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Fiction/JRRTolkien/Shire.pm view on Meta::CPAN
$self->{month},
$self->{day} || $self->{holiday},
),
);
# Because the leap year algorithm is the same in both calendars, I
# can use __rata_die_to_year_day() on the Gregorian Rata Die day.
( $dt_args{year}, $dt_args{day_of_year} ) = __rata_die_to_year_day(
$shire_rd - GREGORIAN_RATA_DIE_TO_SHIRE );
# We may be calling this because we have fiddled with the Shire date
lib/DateTime/Fiction/JRRTolkien/Shire.pm view on Meta::CPAN
}
}
sub last_day_of_month {
my ( $class, %arg ) = @_;
$arg{day} = 30; # The shire calendar is nice this way
return $class->new( %arg );
}
{
my $validator = Params::ValidationCompiler::validation_for(
lib/DateTime/Fiction/JRRTolkien/Shire.pm view on Meta::CPAN
$dt_arg{month} += 1;
$dt_arg{year} += 1900;
return $class->from_object( %arg, object => DateTime->new( %dt_arg ) );
}
sub calendar_name {
return 'Shire';
}
sub clone {
my ( $self ) = @_;
lib/DateTime/Fiction/JRRTolkien/Shire.pm view on Meta::CPAN
*doy = \&day_of_year; # sub doy
sub week { return ($_[0]->week_year, $_[0]->week_number); }
*week_year = \&year; # sub week_year; the shire calendar is nice this way
sub week_number {
my $self = shift;
# TODO re-implement in terms of __week_of_year
my $yday = $self->day_of_year;
lib/DateTime/Fiction/JRRTolkien/Shire.pm view on Meta::CPAN
@midnight,
);
},
quarter => sub {
my ( $self ) = @_;
# This is an extension to the Shire calendar by Tom Wyant.
# It has no textual justification whatsoever. Feel free to
# pretend it does not exist.
if ( my $quarter = $self->quarter() ) {
# The start of a quarter is tricky since quarters 1 and
# 3 start on holidays, so we just do a table lookup.
lib/DateTime/Fiction/JRRTolkien/Shire.pm view on Meta::CPAN
return POSIX::floor( ( ( $_[0]->day - 1 ) / 7 ) + 1 );
}
# ISO says that the first week of a year is the first week containing
# a Thursday. Extending that says that the first week of the month is
# the first week containing a Thursday. ICU agrees.
# ISO does not really apply to the Shire calendar. This method is
# algorithmically the same as the DateTime method, which amounts to
# taking the first week of the year to be the first week containing a
# Hevensday. We return nothing (undef in scalar context) on a holiday
# because zero is a valid return (e.g. for 1 Rethe). -- TRW
sub week_of_month {
lib/DateTime/Fiction/JRRTolkien/Shire.pm view on Meta::CPAN
__END__
=head1 NAME
DateTime::Fiction::JRRTolkien::Shire - DateTime implementation of the Shire calendar.
=head1 SYNOPSIS
use DateTime::Fiction::JRRTolkien::Shire;
lib/DateTime/Fiction/JRRTolkien/Shire.pm view on Meta::CPAN
# On this date in history
print $shire->on_date;
=head1 DESCRIPTION
Implementation of the calendar used by the hobbits in J.R.R. Tolkien's
exceptional novel The Lord of The Rings, as described in Appendix D of
that book (except where noted). The calendar has 12 months, each with
30 days, and 5 holidays that are not part of any month. A sixth
holiday, Overlithe, is added on leap years. The holiday Midyear's Day
(and the Overlithe on a leap year) is not part of any week, which means
that the year always starts on Sterday.
lib/DateTime/Fiction/JRRTolkien/Shire.pm view on Meta::CPAN
object => $object,
...
);
Same as in DateTime, but you can also specify parameters C<accented> and
C<traditional> (see L<new()|/new>). Takes any other DateTime calendar
object and converts it to a DateTime::Fiction::JRRTolkien::Shire object.
=head3 last_day_of_month
$dts = DateTime::Fiction::JRRTolkien::Shire->last_day_of_month(
lib/DateTime/Fiction/JRRTolkien/Shire.pm view on Meta::CPAN
...
);
Same as in DateTime. Like the C<new()> constructor, but it does not
take a day parameter. Instead, the day is set to 30, which is the last
day of any month in the shire calendar. A holiday parameter should not
be used with this method. Use L<new()|/new> instead.
=head3 from_day_of_year
$dts = DateTime::Fiction::JRRTolkien::Shire->from_day_of_year(
lib/DateTime/Fiction/JRRTolkien/Shire.pm view on Meta::CPAN
Creates a new Shire object that is the same date (and underlying time)
as the calling object.
=head2 "Get" Methods
=head3 calendar_name
print $dts->calendar_name(), "\n";
Returns C<'Shire'>.
=head3 year
lib/DateTime/Fiction/JRRTolkien/Shire.pm view on Meta::CPAN
printf "%d %s a leap year\n", $dts->year(),
$ly[ $dts->is_leap_year() ];
Returns 1 if the year is a leap year, and 0 otherwise.
Leap years are given the same rule as the Gregorian calendar. Every
four years is a leap year, except the first year of the century, which
is not a leap year. However, every fourth century (400 years), the
first year of the century is a leap year (every 4, except every 100,
except every 400). This is a slight change from the calendar described
in Appendix D, which uses the rule of once every 4 years, except every
100 years (the same as in the Julian calendar). Given some uncertainty
about how many years have passed since the time in Lord of the Rings
(see note below), and the expectations of most people that the years
match up with what they're used to, I have changed this rule for this
implementation. However, this does mean that this calendar
implementation is not strictly that described in Appendix D.
=head3 week_year
print 'The week year is ', $dts->week_year(), "\n";
This is always the same as the year in the shire calendar, but is
present for compatibility with other DateTime objects.
=head3 week_number
print 'The week number is ', $dts->week_number(), "\n";
lib/DateTime/Fiction/JRRTolkien/Shire.pm view on Meta::CPAN
the day is part of no quarter (Midyear's day and the Overlithe), returns
0.
There is no textual justification for quarters, but they are in the
L<DateTime|DateTime> interface, so I rationalized the concept the same
way the Shire calendar rationalizes weeks. If you are not interested in
non-canonical functionality, please ignore anything involving quarters.
=head3 quarter_0
Returns the number of the quarter the day is in, in the range 0 to 3. If
lib/DateTime/Fiction/JRRTolkien/Shire.pm view on Meta::CPAN
Returns either C<'SR'> if the year is positive, or C<'BSR'> otherwise.
=head3 christian_era
This really does not apply to the Shire calendar, but it is part of the
L<DateTime|DateTime> interface. Despite its name, it returns the same
thing that L<era_abbr()|/era_abbr> does.
=head3 secular_era
lib/DateTime/Fiction/JRRTolkien/Shire.pm view on Meta::CPAN
=head3 utc_rd_values
Returns the UTC rata die days, seconds, and nanoseconds. Ignores
fractional seconds. This is the standard method used by other methods
to convert the shire calendar to other calendars. See the DateTime
documentation for more information.
=head3 utc_rd_as_seconds
Returns the UTC rata die days entirely as seconds.
lib/DateTime/Fiction/JRRTolkien/Shire.pm view on Meta::CPAN
This is a re-implementation imported from
L<Date::Tolkien::Shire::Data|Date::Tolkien::Shire::Data>. It is intended
to be reasonably compatible with the same-named L<DateTime|DateTime>
method, but has some additions to deal with the peculiarities of the
Shire calendar.
See L<__format()|Date::Tolkien::Shire::Data/__format> in
L<Date::Tolkien::Shire::Data|Date::Tolkien::Shire::Data> for the
documentation, since that is the code that does the heavy lifting for
us.
lib/DateTime/Fiction/JRRTolkien/Shire.pm view on Meta::CPAN
falling in any month, it is recommended that a day and month always be
given together. Otherwise, unanticipated results may occur.
As in the L<new()|/new> constructor, time parameters have no effect on
the Shire dates returned. However, they are maintained in case the
object is converted to another calendar which supports time.
All C<set_*()> methods from L<DateTime|DateTime> are provided. In
addition, you get the following:
=head3 set_holiday
lib/DateTime/Fiction/JRRTolkien/Shire.pm view on Meta::CPAN
Similarly, if the date is Midyear's day or the Overlithe, truncation to
C<'week'>, C<'local_week'>, or C<'quarter'> is equivalent to truncation
to C<'day'>, since these holidays are not part of any week (or, by
extension, quarter).
The week in the Shire calendar begins on Sterday, so both C<'week'> and
C<'local_week'> truncate to that day.
There is no textual justification for quarters, but they are in the
L<DateTime|DateTime> interface, so I rationalized the concept the same
way the Shire calendar rationalizes weeks. If you are not interested in
non-canonical functionality, please ignore anything involving quarters.
=head3 set_time_zone
$dts->set_time_zone( 'UTC' );
Just like in DateTime. This method has no effect on the shire calendar,
but be stored with the date if it is ever converted to another calendar
with time support.
=head2 Comparisons and Stringification
All comparison operators should work, just as in DateTime. In addition,
lib/DateTime/Fiction/JRRTolkien/Shire.pm view on Meta::CPAN
into a string representing the date when used in a double-quoted string.
=head2 Durations and Date Math
Durations and date math are supported as of 0.900_01.
Because of the peculiarities of the Shire calendar, the relevant
duration object is
L<DateTime::Fiction::JRRTolkien::Shire::Duration|DateTime::Fiction::JRRTolkien::Shire::Duration>,
which is B<not> a subclass of L<DateTime::Duration|DateTime::Duration>.
The date portion of the math is done in the order L<month|/month>,
lib/DateTime/Fiction/JRRTolkien/Shire.pm view on Meta::CPAN
approximate as an exact and calculated back 6000 years from 1958 and set
this as the start of the 4th age (1422). Thus the fourth age begins in
our B.C 4042.
According to Appendix D of the Lord of the Rings, leap years in the
hobbits' calendar are every 4 years unless it is the turn of the
century, in which case it is not a leap year. Our calendar uses every 4
years unless it is 100 years unless it is 400 years. So, if no changes
had been made to the hobbits' calendar since the end of the third age,
their calendar would be about 15 days further behind ours now then when
the War of the Ring took place. Implementing this seemed to me to go
against Tolkien's general habit of converting dates in the novel to our
equivalents to give us a better sense of time. My thoughts, at least
right now, is that it is truer to the spirit of things for March 25
today to be about the same as March 25 was back then. So instead, I
have modified Tolkien's description of the hobbits' calendar so that
leap years occur once every 4 years unless it is 100 years unless it is
400 years, so that it matches our calendar in that regard. These 100
and 400 year intervals occur at different times in the two calendars,
however. Thus the last day of our year is sometimes 7 Afteryule,
sometimes 8, and sometimes 9.
I<The "I" in the above is Tom Braun -- TRW>
lib/DateTime/Fiction/JRRTolkien/Shire.pm view on Meta::CPAN
Copyright (c) 2003 Tom Braun. All rights reserved.
Copyright (C) 2017-2022, 2025-2026 Thomas R. Wyant, III
The calendar implemented on this module was created by J.R.R. Tolkien,
and the copyright is still held by his estate. The license and
copyright given herein applies only to this code and not to the
calendar itself.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself. For more details, see the full text
of the licenses in the files F<LICENSE-Artistic> and F<LICENSE-GPL>.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Fiscal/Retail454.pm view on Meta::CPAN
This module is a sub-class of C<DateTime> and inherits all methods and
capabilities, including constructors, of that module.
The purpose of this module is to make it easy to work with the 4-5-4
calendar that is common among merchandisers. Details of the calendar itself
can be found at the National Retail Federation (NRF) website.
L<http://www.nrf.com/modules.php?name=Pages&sp_id=391>
All objects returned by any of the methods in this module or of the class
C<DateTime::Fiscal::Retail454> unless otherwise specified.
lib/DateTime/Fiscal/Retail454.pm view on Meta::CPAN
my $r454_2 = DateTime::Fiscal::Retail454->new( year => 2006, month = 1 );
print $r454->r454_year; # print "2005"
Returns a scalar containing the Fiscal Year that the object is in. This is
not always the same as the calendar year, especially for dates in January and
occasionally in February. This is because the start of the Fiscal Year is
tied to what day of the week Jan 31 of any given year falls on.
=head2 is_r454_leap_year
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Fiscal/Year.pm view on Meta::CPAN
=head1 DESCRIPTION
This module allows you to calulate the day, week, period or quarter of a date in a fiscal year, given a
start date and either a target date or number of periods and target date. This is often needed in business,
where the fiscal year begins and ends on different days than the calendar year. This module is based on the
Gregorian calendar. Using other DT calendar objects will return results, but the behavior
is unpredicatable for calendars that have more than 365 or 366 days.
=head1 USAGE
This module implements the following methods:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Format/Epoch/JD.pm view on Meta::CPAN
=head1 DESCRIPTION
This module can convert a DateTime object (or any object that can be
converted to a DateTime object) to the Julian Day number. This is the
number of days since noon U.T.C. on January 1, 4713 B.C. (Julian
calendar).
This time scale was originally proposed by John Herschel, and is
often used in astronomical calculations.
Similar modules are:
lib/DateTime/Format/Epoch/JD.pm view on Meta::CPAN
=item * DateTime::Format::Epoch::Lilian
Implements the Lilian count, named after Aloysius Lilian (a 16th century
physician) and first used by IBM (a 19th century punched card machine
manufacturer). This counts the number of days since the adoption of the
Gregorian calendar. Only days are counted, and October 15, 1584 is day
1.
=back
=head1 METHODS
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Format/EraLegis.pm view on Meta::CPAN
my $dt->set_formatter($dtf);
=head1 DESCRIPTION
These three modules combined enable DateTime objects to emit date strings
formatted according to the Thelemic calendar. The ephemeris provides access
to the planetary location of the Sun and Moon keyed by UTC timestamp. The
style dictates the specific expression of the of datetime value using a
template into which one can place tokens which can be converted into the
sign/degree coordinates for the given date. A default style exists and is
permutable by boolean attributes.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime.pm view on Meta::CPAN
return $object->clone;
}
my ( $rd_days, $rd_secs, $rd_nanosecs ) = $object->utc_rd_values;
# A kludge because until all calendars are updated to return all
# three values, $rd_nanosecs could be undef
$rd_nanosecs ||= 0;
# This is a big hack to let _seconds_as_components operate naively
# on the given value. If the object _is_ on a leap second, we'll
lib/DateTime.pm view on Meta::CPAN
=head1 DESCRIPTION
DateTime is a class for the representation of date/time combinations, and is
part of the Perl DateTime project.
It represents the Gregorian calendar, extended backwards in time before its
creation (in 1582). This is sometimes known as the "proleptic Gregorian
calendar". In this calendar, the first day of the calendar (the epoch), is the
first day of year 1, which corresponds to the date which was (incorrectly)
believed to be the birth of Jesus Christ.
The calendar represented does have a year 0, and in that way differs from how
dates are often written using "BCE/CE" or "BC/AD".
For infinite datetimes, please see the L<DateTime::Infinite|DateTime::Infinite>
module.
lib/DateTime.pm view on Meta::CPAN
=head3 DateTime->from_object( object => $object, ... )
This class method can be used to construct a new DateTime object from any
object that implements the C<utc_rd_values> method. All C<DateTime::Calendar>
modules must implement this method in order to provide cross-calendar
compatibility. This method accepts a C<locale> and C<formatter> parameter
If the object passed to this method has a C<time_zone> method, that is used to
set the time zone of the newly created C<DateTime> object.
lib/DateTime.pm view on Meta::CPAN
=head3 $dt->week
my ( $week_year, $week_number ) = $dt->week;
Returns information about the calendar week for the date. The values returned
by this method are also available separately through the C<< $dt->week_year >>
and C<< $dt->week_number >> methods.
The first week of the year is defined by ISO as the one which contains the
fourth day of January, which is equivalent to saying that it's the first week
to overlap the new year by at least four days.
Typically the week year will be the same as the year that the object is in, but
dates at the very beginning of a calendar year often end up in the last week of
the prior year, and similarly, the final few days of the year may be placed in
the first week of the next year.
=head3 $dt->week_year
lib/DateTime.pm view on Meta::CPAN
ones. Infinite datetime objects are documented in L<DateTime::Infinite>.
=head3 $dt->utc_rd_values
Returns the current UTC Rata Die days, seconds, and nanoseconds as a three
element list. This exists primarily to allow other calendar modules to create
objects based on the values provided by this object.
=head3 $dt->local_rd_values
Returns the current local Rata Die days, seconds, and nanoseconds as a three
lib/DateTime.pm view on Meta::CPAN
is equivalent to this:
@dates = sort { DateTime->compare( $a, $b ) } @dates;
DateTime objects can be compared to any other calendar class that implements
the C<utc_rd_values> method.
=head2 Testing Code That Uses DateTime
If you are trying to test code that calls uses DateTime, you may want to be to
lib/DateTime.pm view on Meta::CPAN
If you can always use the floating or UTC time zones, you can skip ahead to
L<Leap Seconds and Date Math>
=item * date vs datetime math
If you only care about the date (calendar) portion of a datetime, you should
use either C<< $dt->delta_md >> or C<< $dt->delta_days >>, not C<<
$dt->subtract_datetime >>. This will give predictable, unsurprising results,
free from DST-related complications.
=item * $dt->subtract_datetime and $dt->add_duration
lib/DateTime.pm view on Meta::CPAN
answer because it first subtracts one day to get 2003-04-05T03:01:00 and then
subtracts 3 minutes to get the final result.
If we explicitly reverse the order we can get the original value of C<$dt1>.
This can be facilitated by the L<DateTime::Duration> class's C<<
$dur->calendar_duration >> and C<< $dur->clock_duration >> methods:
$dt2->subtract_duration( $dur->clock_duration )
->subtract_duration( $dur->calendar_duration );
=head3 Leap Seconds and Date Math
The presence of leap seconds can cause even more anomalies in date math. For
example, the following is a legal datetime:
lib/DateTime.pm view on Meta::CPAN
pattern. This inconsistency is necessary for backwards compatibility.
There are many cases where CLDR patterns distinguish between the "format" and
"stand-alone" forms of a pattern. The format pattern is used when the thing in
question is being placed into a larger string. The stand-alone form is used
when displaying that item by itself, for example in a calendar.
There are also many cases where CLDR provides three sizes for each item, wide
(the full name), abbreviated, and narrow. The narrow form is often just a
single character, for example "T" for "Tuesday", and may not be unique.
lib/DateTime.pm view on Meta::CPAN
This is a special case. It always produces a two-digit year, so "1976" becomes
"76". Negative years will start with a "-", making them one character longer.
=item * Y{1,}
The year in "week of the year" calendars, from C<< $dt->week_year >>.
=item * u{1,}
Same as "y" except that "uu" is not a special case.
lib/DateTime.pm view on Meta::CPAN
All format modules start with
L<DateTime::Format::|https://metacpan.org/search?q=datetime%3A%3Aformat>.
=head2 Calendar Modules
There are a number of modules on CPAN that implement non-Gregorian calendars,
such as the Chinese, Mayan, and Julian calendars.
All calendar modules start with
L<DateTime::Calendar::|https://metacpan.org/search?q=datetime%3A%3Acalendar>.
=head2 Event Modules
There are a number of modules that calculate the dates for events, such as
Easter, Sunrise, etc.
view all matches for this distribution