view release on metacpan or search on metacpan
lib/Date/ICal.pm view on Meta::CPAN
$ical3 = $ical - $duration;
=head1 DESCRIPTION
Date::ICal talks the ICal date format, and is intended to be a base class for
other date/calendar modules that know about ICal time format also.
=head1 AUTHOR
Rich Bowen, and the Reefknot team. Alas, Reefknot is no more. See
L<https://github.com/houseabsolute/DateTime.pm/wiki> for more modern and accurate modules.
lib/Date/ICal.pm view on Meta::CPAN
my $ical = Date::ICal->new();
If you already have an object in Date::ICal, or some other subclass
thereof, you can create a new Date::ICal (or subclass) object using
that object to start with. This is particularly useful for converting
from one calendar to another:
# Direct conversion from Discordian to ISO dates
my $disco = Date::Discordian->new( disco => '12 Chaos, YOLD 3177' );
my $iso = Date::ISO->new( $disco );
print $iso->iso;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Date/ISO.pm view on Meta::CPAN
$Date: 2003/01/21 15:36:59 $
=head1 Additional comments
For more information about this calendar, please see:
http://personal.ecu.edu/mccartyr/ISOwdALG.txt
http://personal.ecu.edu/mccartyr/isowdcal.html
http://personal.ecu.edu/mccartyr/aboutwdc.htm
http://www.cl.cam.ac.uk/~mgk25/iso-time.html
http://www.fourmilab.ch/documents/calendar/
Finally, many many many thanks to Rick McCarty who provided me with
the algorithms that I'm using for conversions to and from ISO dates.
All the errors in previous versions of this module were entirely my
fault for miscopying something from his algorithm.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Date/ISO8601.pm view on Meta::CPAN
=head1 NAME
Date::ISO8601 - the three ISO 8601 numerical calendars
=head1 SYNOPSIS
use Date::ISO8601 qw(present_y);
lib/Date/ISO8601.pm view on Meta::CPAN
=head1 DESCRIPTION
The international standard ISO 8601 "Data elements and interchange formats
- Information interchange - Representation of dates and times" defines
three distinct calendars by which days can be labelled. It also defines
textual formats for the representation of dates in these calendars.
This module provides functions to convert dates between these three
calendars and Chronological Julian Day Numbers, which is a suitable
format to do arithmetic with. It also supplies functions that describe
the shape of these calendars, to assist in calendrical calculations.
It also supplies functions to represent dates textually in the ISO
8601 formats. ISO 8601 also covers time of day and time periods, but
this module does nothing relating to those parts of the standard; this
is only about labelling days.
The first ISO 8601 calendar divides time up into years, months, and days.
It corresponds exactly to the Gregorian calendar, invented by Aloysius
Lilius and promulgated by Pope Gregory XIII in the late sixteenth century,
with AD (CE) year numbering. This calendar is applied to all time,
not just to dates after its invention nor just to years 1 and later.
Thus for ancient dates it is the proleptic Gregorian calendar with
astronomical year numbering.
The second ISO 8601 calendar divides time up into the same years as
the first, but divides the year directly into days, with no months.
The standard calls this "ordinal dates". Ordinal dates are commonly
referred to as "Julian dates", a mistake apparently deriving from true
Julian Day Numbers, which divide time up solely into linearly counted
days.
The third ISO 8601 calendar divides time up into years, weeks, and days.
The years approximate the years of the first two calendars, so they stay
in step in the long term, but the boundaries differ. This week-based
calendar is sometimes called "the ISO calendar", apparently in the belief
that ISO 8601 does not define any other. It is also referred to as
"business dates", because it is most used by certain businesses to whom
the week is the most important temporal cycle.
The Chronological Julian Day Number is an integral number labelling each
lib/Date/ISO8601.pm view on Meta::CPAN
digits for all year numbers (as the Long Now Foundation does), then the
right tool is C<sprintf> (see L<perlfunc/sprintf>).
This format is unconditionally conformant to all versions of ISO 8601
for years [1583, 9999]. For years [0, 1582], preceding the historical
introduction of the Gregorian calendar, it is conformant only where
it is mutually agreed that such dates (represented in the proleptic
Gregorian calendar) are acceptable. For years outside the range [0,
9999], where the expanded format must be used, the result is only
conformant to ISO 8601:2004 (earlier versions lacked these formats),
and only where it is mutually agreed to use this format.
=cut
lib/Date/ISO8601.pm view on Meta::CPAN
return $sign.$digits;
}
=back
=head2 Gregorian calendar
Each year is divided into twelve months, numbered [1, 12]; month number
1 is January. Each month is divided into days, numbered sequentially
from 1. The month lengths are irregular. The year numbers have
unlimited range.
lib/Date/ISO8601.pm view on Meta::CPAN
=head2 Ordinal dates
Each year is divided into days, numbered sequentially from 1. The year
lengths are irregular. The years correspond exactly to those of the
Gregorian calendar.
=over
=item year_days(YEAR)
lib/Date/ISO8601.pm view on Meta::CPAN
return sprintf("%s-%03d", present_y($y), _numify($d));
}
=back
=head2 Week-based calendar
Each year is divided into weeks, numbered sequentially from 1. Each week
is divided into seven days, numbered [1, 7]; day number 1 is Monday.
The year lengths are irregular. The year numbers have unlimited range.
The years correspond to those of the Gregorian calendar. Each week is
associated with the Gregorian year that contains its Thursday and hence
contains the majority of its days.
=over
view all matches for this distribution
view release on metacpan or search on metacpan
demo/example.pl view on Meta::CPAN
$k = $t - 50 if $t >= 57;
$k = ($t-1) % 7 if ($t >0) & ($t <57);
print "Karana ", $karanaid->[$k], " ends at ", hms($th{$t}), "\n";
}
# Compute traditional saka date for the gregorian calendar date.
# Takes care of inter calary months.
sub greg2saka{
my $self = shift;
my $sun = $self->sun();
my ($sr, $ss, $flag) = $self -> sunriseset();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Date/JD.pm view on Meta::CPAN
# and 509 other conversion functions
=head1 DESCRIPTION
For date and time calculations it is convenient to represent dates by
a simple linear count of days, rather than in a particular calendar.
This is such a good idea that it has been invented several times.
If there were a single such linear count then it would be the obvious
data interchange format between calendar modules. With several
versions, calendar modules can use such sensible data formats and still
have interoperability problems. This module tackles that problem,
by performing conversions between different flavours of day count.
These day count systems are generically known as "Julian Dates", after
the most venerable of them.
lib/Date/JD.pm view on Meta::CPAN
This quantity naming pattern is derived from JD (Julian Date) and JDN
(Julian Day Number) which have the described correspondence. Most of
the other flavours of day count listed below conventionally come in only
one of the two varieties. The "XYZDF" name type is a neologism.
All calendar dates given are in ISO 8601 form (Gregorian calendar with
astronomical year numbering). An hour number is appended to each date,
separated by a "T"; hour 00 is midnight at the start of the day and hour
12 is noon in the middle of the day. An appended "Z" indicates that the
date is to be interpreted in Universal Time (the timezone of the prime
meridian), and so is absolute; where any other timezone is to be used
lib/Date/JD.pm view on Meta::CPAN
=item JD (Julian Date)
days elapsed since -4713-11-24T12Z. This epoch is the most recent
coincidence of the first year of the Metonic cycle, indiction cycle, and
day-of-week cycle, using the Julian calendar. It was correspondingly
named after the Julian calendar, and thus after Julius Caesar. Some
information can be found at L<http://en.wikipedia.org/wiki/Julian_day>.
=item RJD (Reduced Julian Date)
days elapsed since 1858-11-16T12Z (JD 2400000.0). Rarely used.
lib/Date/JD.pm view on Meta::CPAN
=item LD (Lilian Date)
days elapsed since 1582-10-14T00 in the timezone of interest (CJD
2299160.0). This epoch is the day before the day that the Gregorian
calendar first went into use. It is named after Aloysius Lilius, the
inventor of the Gregorian calendar.
=back
The interesting differences between these flavours are whether the
day starts at noon or at midnight, and whether they are absolute or
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Date/Japanese/Era/Table/Builder.pm view on Meta::CPAN
=head1 DESCRIPTION
This module is used to define the conversion table used by L<Date::Japanese::Era>, unfettered by concepts such as "post-gregorian-calender", "past eras only" and "factually correct".
The module has three primary uses: The (far) past, the (far) future, and the (alternate) present, and was written as a writing aid when dealing with stories relating to future eras of Japan, although it's equally useful for quick conversion of old er...
=head1 METHODS
=over 4
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Date/Japanese/Era.pm view on Meta::CPAN
=encoding utf-8
=head1 NAME
Date::Japanese::Era - Conversion between Japanese Era / Gregorian calendar
=head1 SYNOPSIS
use utf8;
use Date::Japanese::Era;
lib/Date/Japanese/Era.pm view on Meta::CPAN
$era = Date::Japanese::Era->new("æå52å¹´");
=head1 DESCRIPTION
Date::Japanese::Era handles conversion between Japanese Era and
Gregorian calendar.
=head1 METHODS
=over 4
lib/Date/Japanese/Era.pm view on Meta::CPAN
=over 4
=item *
Currently supported era is up to 'meiji'. And before Meiji 05.12.02,
gregorius calendar was not used there, but lunar calendar was. This
module does not support lunar calendar, but gives warnings in such
cases ("In %d they didn't use gregorius calendar").
To use calendar ealier than that, see
L<DateTime::Calendar::Japanese::Era>, which is based on DateTime
framework and is more comprehensive.
=item *
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Date/Korean.pm view on Meta::CPAN
}
else {
croak "Invalid date.";
}
}
# solar 1582-10-15 -> cjd:2299161 ,After this are gregorian calendar range.
if ( $days < 2299161 ) { # julian calendar range
# gregorian 1582-10~05 ~ 1582-10-14 dates do not exist.
if ( $year==1582 && $month==10 && $day>=5 && $day<=14) {
croak "The gregorian date does not exist\n";
}
$days = DateTime::Calendar::Julian
lib/Date/Korean.pm view on Meta::CPAN
# get ganzi in korean
my ($saecha, $wolgun, $iljin) = get_ganzi_ko(2008, 9, 12, 0);
=head1 DESCRIPTION
The traditional korean lunisolar calendar is based on the chinese calendar. This module handles conversion between Korean solar and lunisolar date.
=head1 FUNCTIONS
=over 4
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Date/Lectionary/Daily.pm view on Meta::CPAN
The Time::Piece object date of the day you woudl like the lessons for.
=head3 lectionary
One of two choices `acna-sec` for the new secular calendar based ACNA daily lectionary or `acna-xian` for the previous liturgically-based ACNA daily lectionary.
If lectionary is not given at construction, the ACNA secular daily lectionary â `acna-sec` â will be used.
=head2 ATTRIBUTES
lib/Date/Lectionary/Daily.pm view on Meta::CPAN
Presently only returns `acna`. Future version of the module may include daily lectionary from other traditions.
=head3 type
Returns `secular` for daily lectionaries based on the secular/civil calendar and `liturgical` for daily lectionaries based on the liturgical calendar.
=head3 readings
A hasref of the readings for the day.
lib/Date/Lectionary/Daily.pm view on Meta::CPAN
}
=head2 _buildType
Private method to determine if the daily lectionary follows the secular calendar or the liturgical calendar.
=cut
sub _buildType {
my $lectionary = shift;
lib/Date/Lectionary/Daily.pm view on Meta::CPAN
return 0;
}
=head2 _buildReadingsLiturgical
Private method that returns an ArrayRef of strings for the lectionary readings associated with the date according to the liturgical calendar.
=cut
sub _buildReadingsLiturgical {
my $weekName = shift;
lib/Date/Lectionary/Daily.pm view on Meta::CPAN
return \%readings;
}
=head2 _buildReadingsSecular
Private method that returns an ArrayRef of strings for the lectionary readings associated with the date according to the secular calendar.
=cut
sub _buildReadingsSecular {
my $weekName = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Date/Lectionary.pm view on Meta::CPAN
use Time::Piece;
use Date::Lectionary;
my $epiphany = Date::Lectionary->new('date'=>Time::Piece->strptime("2017-01-06", "%Y-%m-%d"));
say $epiphany->day->name; #String representation of the name of the day in the liturgical calendar; e.g. 'The Epiphany'
say $epiphany->year->name; #String representation of the name of the liturgical year; e.g. 'A'
say ${$epiphany->readings}[0] #String representation of the first reading for the day.
=head1 DESCRIPTION
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Date/MSD.pm view on Meta::CPAN
# and 69 other conversion functions
=head1 DESCRIPTION
For date and time calculations it is convenient to represent dates by
a simple linear count of days, rather than in a particular calendar.
This module performs conversions between different flavours of linear
count of Martian solar days ("sols").
Among Martian day count systems there are also some non-trivial
differences of concept. There are systems that count only complete days,
lib/Date/MSD.pm view on Meta::CPAN
This quantity naming pattern is derived from the naming of Terran day
counts, particularly JD (Julian Date) and JDN (Julian Day Number) which
have the described correspondence. The "XYZF" name type is a neologism,
invented for L<Date::JD>.
All calendar dates given are in the Darian calendar for Mars. An hour
number is appended to each date, separated by a "T"; hour 00 is midnight
at the start of the day. An appended "Z" indicates that the date is to
be interpreted in the timezone of the prime meridian (Airy Mean Time),
and so is absolute; where any other timezone is to be used then this is
explicitly noted.
lib/Date/MSD.pm view on Meta::CPAN
days elapsed since 0000-01-01T00Z (MSD -94129.0) (approximately
MJD -91195.22 in Terrestrial Time). This epoch is an Airy
midnight approximating the last northward equinox prior to
the first telescopic observations of Mars. The same epoch is
used for the Darian calendar for Mars. JS is defined (but not
explicitly) by the document describing the Darian calendar, at
L<http://pweb.jps.net/~tgangale/mars/converter/calendar_clock.htm>.
=item CMSD (Chronological Mars Solar Date)
days elapsed since -0608-23-20T00 in the timezone of interest.
CMSD = MSD + 500000.0 + Zoff, where Zoff is the timezone
view all matches for this distribution
view release on metacpan or search on metacpan
internal/data.misc.pl view on Meta::CPAN
# The following zone(s) will not use a LAST RULE to calculate time zone
# changes past $keep_year. Instead, they will use all dates from a dump,
# and nothing beyond that.
#
# Asia/Jerusalem uses a non-standard way based on the Hebrew calendar.
%no_last = map { $_,1 } qw(Asia/Jerusalem Asia/Tehran);
1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Date/Maya.pm view on Meta::CPAN
my ($long, $tzolkin, $haab) = julian_to_maya 2451432;
my $julian = maya_to_julian '12.19.6.9.9';
=head1 DESCRIPTION
For an extensive description of both the Maya calendar and Julian days,
see the calendar faq [1].
This module presents routines to calculate the Mayan day from a Julian
day, and a Julian day from a Mayan day. The Mayan calendar has different
dating systems, the Long Count (which cycles every 5125 years), the
Tzolkin (260 days) and the Haab (365 days). The Long Count consists
of quintuple of numbers (really a mixed base 20/18 number), while the
Tzolkin and the Haab consist of day numbers and week or month names. In
the Tzolkin, both the week number and week name change from day to day;
lib/Date/Maya.pm view on Meta::CPAN
the Long Count date, the Tzolkin date, and the Haab date. C<maya_to_julian>
takes a Long Count date as argument, and returns a Julian day.
=head2 EPOCH AND ROLL OVER
It is unclear when the epoch of the Mayan calendar occurred. Three dates
are mentioned as candidates, S<13 Aug 3114 BC>, S<11 Aug 3114 BC>, and
S<15 Oct 3374 BC>. Unless changed, this module assumes S<13 Aug 3114> as
the epoch.
To change the epoch, import the function C<maya_epoch>, and call it with the
Julian date that should be the epoch. Constants C<MAYA_EPOCH1>, C<MAYA_EPOCH2>
and C<MAYA_EPOCH3> can be imported, which will have the Julian days for
S<13 Aug 3114 BC>, S<11 Aug 3114 BC>, and S<15 Oct 3374 BC> as values.
The three constants can be imported at once by using the C<:MAYA_EPOCH> tag.
The Mayan calendar is cyclic, with a period of just over 5125 years. This
means that if the epoch was in S<Aug 3114 BC>, the calendar will roll over
in S<Dec 2012 AD>. If the epoch was in S<3374 BC>, the roll over has occured
over 200 years ago. Since the calendar is cyclic, the C<maya_to_julian> function
is not unique. We will however return only one date, and that is the first
Julian day matching the Long Count date on or after the choosen epoch.
The Mayan Long Count calendar rolls over after 1872000 days.
=head1 REFERENCES
=over 4
=item [1]
Tondering, Claus: I<FREQUENTLY ASKED QUESTIONS ABOUT CALENDARS>
L<< http://www.tondering.dk/claus/calendar.html >>
=back
=head1 SEE ALSO
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Date/Namedays/Simple.pm view on Meta::CPAN
# years are not taken into consideration!
###########################################################
sub getNames {
my ($self, $month, $day, $year) = @_;
# some calendars handle leap-years in a special way... like
# the Hungarian, which is totally insane
my $leapyearmonth = 0;
my $leapyearmonth = 1 if ($year && (not ($year % 4) ) && ($month == 2));
# note: this is a VERY lame leap-year calculation here...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Date/Object.pm view on Meta::CPAN
}
return undef ;
}
# The Egyptians called it 365 and left it at that. But their calendar got out of step with the seasons, so that
# after around 750 years of this they were celebrating The Fourth of July in the middle of the winter.
#
# The Romans wised up and added the leap day every four years to get the 365.25 day Julian year. Much better,
# but notice that this time the year is longer than it ought to be. The small difference between this and the
# true length of the year caused the seasons to creep through the calendar once again, only slower and in the
# other direction. After about 23000 years of this, July Fourth would once again fall in mid-winter.
#
# Fortunately things never reached that sad state. By 1582 the calendar was about ten days out of whack, so
# Pope Gregory XIII included the correction that's still in use today.
#
# "If the year is divisible by 100, it's not a leap year UNLESS it is also divisible by 400."
#
# More recently, proposals for fixes have gotten even better than that. One suggested change is to add on "if
lib/Date/Object.pm view on Meta::CPAN
__END__
=head1 NAME
Date::Object - Handles dates/calendars/timezones and it's representation/convertions using a single Date::Object.
=head1 DESCRIPTION
Date::Object is an alternative to the L<DateTime> modules, with the main pourpose
to handle dates using a single object or make multiple I<Date::Object>s work together
view all matches for this distribution
view release on metacpan or search on metacpan
Pcalendar.pm view on Meta::CPAN
## This package is free software; you can redistribute it ##
## and/or modify it under the same terms as Perl itself. ##
## ##
###############################################################################
package Date::Pcalendar;
BEGIN { eval { require bytes; }; }
use strict;
use vars qw( @ISA @EXPORT @EXPORT_OK $VERSION );
Pcalendar.pm view on Meta::CPAN
$VERSION = '6.1';
use Carp::Clan qw(^Date::);
use Date::Pcalc::Object qw(:ALL);
use Date::Pcalendar::Year qw( check_year empty_period );
sub new
{
my($class) = shift;
my($profile) = shift;
my($language) = shift || 0;
my($self);
$self = [ ];
$class = ref($class) || $class || 'Date::Pcalendar';
bless($self, $class);
$self->[0] = { };
$self->[1] = $profile;
$self->[2] = $language;
$self->[3] = [@_];
Pcalendar.pm view on Meta::CPAN
return $self->[0]{$year};
}
else
{
return $self->[0]{$year} =
Date::Pcalendar::Year->new( $year, $self->[1], $self->[2], @{$self->[3]} );
}
}
sub cache_keys
{
view all matches for this distribution
view release on metacpan or search on metacpan
0.13 Fri Aug 05 14:45:00 2016
- Updated the dependency on Date::Utils v0.21.
0.12 Sat Jul 23 12:00:00 2016
- Updated the dependency on Date::Utils v0.20.
- Dropped method get_calendar() as it's no longer relevant here.
0.11 Wed Jun 29 11:15:00 2016
- Addressed issue raised in the CPAN Tester Report.
http://www.cpantesters.org/cpan/report/5d3ad818-3d02-11e6-a5ff-abe4273a1f7f
- Renamed method get_days_in_persian_month_year() to days_in_month_year().
- Updated unit test to respect the above change.
0.09 Thu May 19 10:15:00 2016
- Updated the dependency on Date::Utils v0.19.
- Updated method get_calendar() and method as_string() to use get_month_name().
- Renamed method persian_months() to months().
- Renamed method persian_days() to days().
- Updated method get_calendar() to respect the above changes.
0.08 Tue Apr 26 10:35:00 2016
- Updated the dependency on Date::Utils v0.16.
- Added $AUTHORITY.
- Added section "SEE ALSO".
0.07 Wed Aug 26 09:35:00 2015
- Added the dependency on Date::Utils v0.11.
0.06 Sat Jul 18 07:45:00 2015
- Added the dependency on Date::Utils v0.10.
- Added method get_calendar().
0.05 Sun Jul 05 17:50:00 2015
- Added the dependency on Date::Utils v0.09.
0.04 Fri Jun 26 14:45:00 2015
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Date/Piece.pm view on Meta::CPAN
This is useful for constructs such as "tomorrow", "yesterday", "this
time tomorrow", "one week from today", "one month later", "my 31st
birthday", and various other not-necessarily-numeric intervals on the
arbitrary and edge-case-laden division of time known by most earthlings
as "the calendar." That is, adding days or months is analogous to
counting squares or turning pages on a calendar.
This module extends Date::Simple and connects it to Time::Piece. See
Date::Simple for more details.
=head1 Immutable
lib/Date/Piece.pm view on Meta::CPAN
=head1 Fuzzy Math
We can do math with months and years as long as you're flexible about
the day of the month. The theme here is to keep the answer within the
destination calendar month rather than adding e.g. 30 days.
=head2 adjust_day_of_month
Returns a valid date even if the given day is beyond the last day of the
month (returns the last day of that month.)
view all matches for this distribution
view release on metacpan or search on metacpan
examples/synopsis.pl view on Meta::CPAN
use warnings;
use strict;
use utf8;
use Date::Qreki ':all';
my @qreki = calc_kyureki (2017, 1, 31);
print "Old calendar $qreki[0] $qreki[2] $qreki[3]\n";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Date/Remind/Event.pm view on Meta::CPAN
print 'Description: '. $e->body ."\n";
=head1 DESCRIPTION
B<Date::Remind::Event> provides a Perl object interface to textual
events emitted by the L<remind>(1) calendar program. The expected
format of the input is the same as what is produced by "remind -s" (as
defined in the L<rem2ps>(1) manpage under "REM2PS INPUT FORMAT").
L<remind>(1) produces slightly different output depending on the value
of the -b flag. To make sure that Date::Remind::Event handles this
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Date/Roman.pm view on Meta::CPAN
<annus> = 1*DIGIT
<spaces> = 1*WSP
We use the "b6" prefix to indicate the leap day (24th february)
introduced in leap tears. As it is stated below in section L<The days
in the Roman calendar>, this was again the 6th day before the Kalendae
of March, exatly as the day after.
=head2 The I<ical> format
The I<ical> format is a generalization of the format for dates defined
lib/Date/Roman.pm view on Meta::CPAN
=head1 THE ROMAN CALENDAR
=head2 The Julian reform, the month length
Julius Caesar made his famous calendar reform in S<45 BC>. According to
this reform, the year was of 365 days, divided in 12 months:
Ianuarius, 31 days; Februaarius, 28 days, Martius, 31 days; Aprilis,
30 days; Maius, 31 days, Iunius, 30 days, Iulius, 31 days; Sextilis 31
days, September, 30 days, October, 31 days; November, 30 days; and
December, 31 days. Later, Sextilis became Augustus (to simplify, we
lib/Date/Roman.pm view on Meta::CPAN
account the Gregorian reform assuming that it took place in
S<1582 AD>. It does not take into account the problems in determining
leap years between S<45 BC> and S<8 AD> (at least it does not yet,
L<see the section TODO above|TODO>).
=head2 The days in the Roman calendar
The Romans didn't number the days sequentially from 1. Instead they
had three fixed days in each month:
=over
lib/Date/Roman.pm view on Meta::CPAN
is the year S<2755 AUC> (ab Urbe condita, after the foundation
of the City).
=head2 What before the Julian reform?
Before Julius Caesar introduced the Julian calendar in S<709 AUC>, the
Roman calendar was a mess, and much of our so-called ``knowledge''
about it seems to be little more than guesswork. This module uses the
Julian calendar also for dates before the 1 Jan S<45 BC> (or, more
precisely, Kalendas Ianuariis S<DCCIX AUC>). This is the so called
'proleptic Julian calendar' and it is consistent with the historians'
habit to do so.
=head1 AUTHOR
lib/Date/Roman.pm view on Meta::CPAN
=head2 Web
The very good Frequently Asked Questions about Calendars by Claus
Tondering. You can found it at
http://www.tondering.dk/claus/calendar.html
See especially section 2.7.
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
0.15 Sat Aug 06 11:45:00 2016
- Updated the dependency on Date::Utils v0.21.
0.14 Sun Jul 24 08:50:00 2016
- Updated the dependency on Date::Utils v0.20.
- Dropped method get_calendar() as it's no longer relevant here.
0.13 Thu Jun 30 10:30:00 2016
- Addressed issue raised in the CPAN Tester Report.
http://www.cpantesters.org/cpan/report/48e6a3f6-3d02-11e6-a5ff-abe4273a1f7f
- Refactored method days_in_chaitra() and days_in_month_year().
- Added missing dependency on Date::Exception.
0.11 Fri May 20 10:30:00 2016
- Updated the dependency on Date::Utils v0.19.
- Updated method get_calendar() and method as_string() to use get_month_name().
- Renamed method saka_months() to months().
- Renamed method saka_days() to days().
- Renamed method get_days_in_saka_month_year() to get_days_in_month_year().
- Updated method get_calendar() to respect the above changes.
0.10 Sat Apr 23 13:20:00 2016
- Updated the dependency on Date::Utils v0.16.
- Added section "SEE ALSO".
- Updated copyright year information.
- add_years()
- minus_years()
0.08 Mon Jul 20 11:45:00 2015
- Added the dependency on Date::Utils v0.10.
- Added method get_calendar().
0.07 Mon Jul 06 09:15:00 2015
- Added the dependency on Date::Utils v0.09.
- Tidied up pod document in general.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Date/Simple/Month.pm view on Meta::CPAN
my @wraparound_dates_from_tuesday = $month->wraparound_dates(2);
=head1 DESCRIPTION
Date::Simple::Month is a subclass of Date::Range that represents a complete calendar month
consisted of Date::Simple objects.
=head1 METHOD
=head2 new
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Date/Span.pm view on Meta::CPAN
#pod print "from $_->[0] to $_->[1]\n" for (@spanned);
#pod
#pod =head1 DESCRIPTION
#pod
#pod This module provides code for dealing with datetime ranges that span multiple
#pod calendar days. This is useful for computing, for example, the amount of
#pod seconds spent performing a task on each day. Given the following table:
#pod
#pod event | begun | ended
#pod ---------+------------------+------------------
#pod loading | 2004-01-01 00:00 | 2004-01-01 12:45
lib/Date/Span.pm view on Meta::CPAN
print "from $_->[0] to $_->[1]\n" for (@spanned);
=head1 DESCRIPTION
This module provides code for dealing with datetime ranges that span multiple
calendar days. This is useful for computing, for example, the amount of
seconds spent performing a task on each day. Given the following table:
event | begun | ended
---------+------------------+------------------
loading | 2004-01-01 00:00 | 2004-01-01 12:45
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Date/SundayLetter.pm view on Meta::CPAN
# sub parameter {{{
sub parameter {
# The "parameter" is a magic number that tracks how far the Gregorian
# calendar is from the Julian calendar. It has roughly to do with the
# fact that the Gregorian calendar observes leap year on the 4-century
# mark, and the Julian calendar does not.
my $year = shift;
my $S = int ($year / 100 );
my $P = ( int( $S/4 ) - $S ) % 7;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Date/Tie.pm view on Meta::CPAN
=head1 DESCRIPTION
Date::Tie is an attempt to simplify date operations syntax.
It works with calendar dates (year-month-day),
ordinal dates (year-day), week dates (year-week-day),
times (hour:minute:second), decimal fractions (decimal hours,
decimal minutes and decimal seconds), and time-zones.
Whenever a Date::Tie hash key receives a new value, it will change
lib/Date/Tie.pm view on Meta::CPAN
=item I<year>, I<month>, I<day> or I<monthday>, I<hour>, I<minute>, I<second>
These keys are just what they say.
You can use B<I<monthday>> instead of I<day> if you want to make it clear
it is not a I<yearday> (ordinal calendar) or a I<weekday> (week calendar).
=item I<yearday>, I<week>, I<weekday>, I<weekyear>
B<I<yearday>> is the day number in the year.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/My/Module/Meta.pm view on Meta::CPAN
bless $self, $class;
return $self;
}
sub abstract {
return 'Data functionality for Shire calendars.';
}
sub add_to_cleanup {
return [ qw{ cover_db xt/author/optionals } ];
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Date/Tolkien/Shire.pm view on Meta::CPAN
year => 1419,
holiday => 3,
);
This method sets the object's date to the given date in the Shire
calendar. The named arguments are C<year>, C<month>, C<day>, and
C<holiday>, and all are numeric. The C<year> argument is required; all
others are optional. You may not specify both C<month> and C<holiday>.
If C<month> is specified, C<day> defaults to C<1>; otherwise C<holiday>
defaults to C<1>.
lib/Date/Tolkien/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/Date/Tolkien/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/Date/Tolkien/Shire.pm view on Meta::CPAN
Copyright (c) 2001-2003, 2006 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/Date/Utility.pm view on Meta::CPAN
Takes the following argument as named parameter:
=over 4
=item * C<year> - calendar year of the date (Integer)
=item * C<month> - calendar month of the date. (Integer)
=item * C<day> - day of the month of the date. (Integer)
=back
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Date/Utils.pm view on Meta::CPAN
L<https://github.com/manwar/Date-Utils>
=head1 ACKNOWLEDGEMENTS
Entire logic is based on the L<code|http://www.fourmilab.ch/documents/calendar> written by John Walker.
=head1 SEE ALSO
=over 4
view all matches for this distribution