DateTime-Calendar-Pataphysical
view release on metacpan or search on metacpan
0.04 2004-07-29 PIJLL - the "Transfiguration of Saint V. van Gogh" release
- added classification of holidays
- changed year count for years before the Pataphysical Era (1873):
there is no year 0 in the Pataphysical Calendar
- added t/pod.t
0.03 2003-09-02 PIJLL - the "Saint Lazare (station)" release
- move to the "Locale" system
- store rd_seconds and rd_nanoseconds in the object in from_object;
return this value if object is converted back to another calendar
0.02 2003-04-04 PIJLL - the "Nativity of Maldoror" release
- corrected utc_rd_as_seconds()
- added language parameter to from_epoch, from_object,
last_day_of_month
- corrected from_object to remove time zone problems
0.01 2003-03-29 PIJLL - the "Hand of Glory" release
- original version
{
"abstract" : "Dates in the Pataphysical calendar",
"author" : [
"Eugene van der Pijll <pijll@cpan.org>"
],
"dynamic_config" : 0,
"generated_by" : "Dist::Zilla version 6.024, CPAN::Meta::Converter version 2.150010",
"keywords" : [
"datetime",
"calendar",
"pataphysical",
"pataphysics"
],
"license" : [
"perl_5"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : 2
},
},
"provides" : {
"DateTime::Calendar::Pataphysical" : {
"file" : "lib/DateTime/Calendar/Pataphysical.pm",
"version" : "0.07"
}
},
"release_status" : "stable",
"resources" : {
"bugtracker" : {
"mailto" : "bug-datetime-calendar-pataphysical@rt.cpan.org",
"web" : "http://rt.cpan.org/NoAuth/Bugs.html?Dist=DateTime-Calendar-Pataphysical"
},
"repository" : {
"type" : "git",
"url" : "http://github.com/book/DateTime-Calendar-Pataphysical.git",
"web" : "http://github.com/book/DateTime-Calendar-Pataphysical"
}
},
"version" : "0.07",
"x_contributors" : [
---
abstract: 'Dates in the Pataphysical calendar'
author:
- 'Eugene van der Pijll <pijll@cpan.org>'
build_requires:
DateTime: '0'
ExtUtils::MakeMaker: '0'
File::Spec: '0'
Test::MockTime: '0'
Test::More: '0'
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 0
generated_by: 'Dist::Zilla version 6.024, CPAN::Meta::Converter version 2.150010'
keywords:
- datetime
- calendar
- pataphysical
- pataphysics
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: DateTime-Calendar-Pataphysical
provides:
DateTime::Calendar::Pataphysical:
file: lib/DateTime/Calendar/Pataphysical.pm
Makefile.PL view on Meta::CPAN
# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.024.
use strict;
use warnings;
use 5.006;
use ExtUtils::MakeMaker;
my %WriteMakefileArgs = (
"ABSTRACT" => "Dates in the Pataphysical calendar",
"AUTHOR" => "Eugene van der Pijll <pijll\@cpan.org>",
"CONFIGURE_REQUIRES" => {
"ExtUtils::MakeMaker" => 0
},
"DISTNAME" => "DateTime-Calendar-Pataphysical",
"LICENSE" => "perl",
"MIN_PERL_VERSION" => "5.006",
"NAME" => "DateTime::Calendar::Pataphysical",
"PREREQ_PM" => {
"DateTime::Duration" => 0,
DateTime-Calendar-Pataphysical
==============================
This module implements the pataphysical calendar, perpetrated by Alfred
Jarry.
INSTALLATION
To install this module type the following:
perl Makefile.PL
make
make test
make install
Params::Validate = 0.52
[Prereqs / TestRequires]
Test::MockTime = 0
Test::More = 0
[ExecDir]
[ShareDir]
[Keywords]
keywords = datetime calendar pataphysical pataphysics
[MetaResources]
repository.web = http://github.com/book/DateTime-Calendar-Pataphysical
repository.url = http://github.com/book/DateTime-Calendar-Pataphysical.git
repository.type = git
bugtracker.web = http://rt.cpan.org/NoAuth/Bugs.html?Dist=DateTime-Calendar-Pataphysical
bugtracker.mailto = bug-datetime-calendar-pataphysical@rt.cpan.org
[MetaProvides::Package]
[Meta::Contributors]
contributor = Philippe Bruhat (BooK) <book@cpan.org>
contributor = Jean Forget <jforget@cpan.org>
contributor = Paul Cochrane <ptc@cpan.org>
; tests
[MetaTests]
lib/DateTime/Calendar/Pataphysical.pm view on Meta::CPAN
return $class->new( year => $y, month => $m, day => $d,
rd_secs => $rd_secs||0, rd_nano => $rd_nano||0,
locale => $p{locale} );
}
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;
my $a = _floor(($rd-0.25)/(100*365.2425));
my $b = $rd - 0.25 + $a - _floor($a/4);
my $y = _floor($b/365.25);
my $d = $rd + $a - _floor($a/4) - _floor(365.25*$y);
lib/DateTime/Calendar/Pataphysical.pm view on Meta::CPAN
locale
mday_0
mon
mon_0
month_0
=encoding utf-8
=head1 NAME
DateTime::Calendar::Pataphysical - Dates in the Pataphysical calendar
=head1 VERSION
version 0.07
=head1 SYNOPSIS
use DateTime::Calendar::Pataphysical;
$dt = DateTime::Calendar::Pataphysical->new( year => 1752,
month => 10,
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.
=head1 CLASS METHODS
=head2 new
my $dt = DateTime::Calendar::Pataphysical-new(
year => $year_in_the_pataphysical_era,
month => $pataphysical_month_number,
day => $pataphysical_day_number,
);
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, ... );
This class method can be used to construct a new object from an epoch
time instead of components. Just as with the L<new> constructor, it
accepts a C<locale> parameter.
=head2 now
lib/DateTime/Calendar/Pataphysical.pm view on Meta::CPAN
This class method is equivalent to calling C<from_epoch()> with the
value returned from Perl's L<time|perlfunc/time> function.
=head2 from_object
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
my $dt = DateTime::Calendar::Pataphysical->last_day_of_month( ... );
This constructor takes the same arguments as can be given to the
L<now> method, except for C<day>. Additionally, both C<year> and
C<month> are required.
lib/DateTime/Calendar/Pataphysical.pm view on Meta::CPAN
=head2 is_leap_year
This method returns a true or false indicating whether or not the
L<DateTime> object is in a leap year.
=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>.
The 29th of each month falls outside of any week; C<week_number> returns
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.
This is useful when you need a single number to represent a date.
=head2 strftime
my $string = $dt->strftime( $format, ... );
( run in 0.565 second using v1.01-cache-2.11-cpan-5dc5da66d9d )