Date-Roman

 view release on metacpan or  search on metacpan

lib/Date/Roman.pm  view on Meta::CPAN

=back

=head1 TODO

=over

=item 1

Add time management. This will require to determine sunraise/sunset
time for the given day.


=item 2

Change the C<_leap> subroutine to reflect the fact that between 
S<45 BC> (S<709 AUC>) and S<9 BC> (S<745 AUC>) there was a leap year every
B<three> years, then between S<8 BC> (S<744 AUC>) and S<7 AD> 
(S<760 AUC>) there was no leap year to make up for the three exceeding leap
years.

=item 3

Add Ante Urbe Condida years.

=item 4

Rewrite the module in Latin using the B<Lingua::Romana::Perligata>
module.

=back

=head1 DATE FORMATS

Dates can be specified by a string in one of two formats: I<roman>
and I<ical>.


=head2 The I<roman> format.

It is a simplified version of the roman way to write dates 
(L<see the section THE ROMAN CALENDAR below|THE ROMAN CALENDAR>). 
It is defined by the following ABNF specification (see rfc2234):

   <roman date> = [<prefix><spaces>]<fixed day><spaces><mons><spaces><annus>
   <prefix>     = 1*2DIGIT     ; "1".."4" / "1".."6" / "1".."8" /
                               ; "1".."16" / "1".."17" /
                               ; "1".."18" / "1".."19"
                               ; according to <mons> <fixed day>
                               ; value.

   <prefix>    /= "b6"         ; only for <mons> equal to "3", <fixed day> 
                               ; equal to "kal" and <annus> equal to a 
                               ; leap year.
   <fixed day>  = "kal" / "non" / "id"
   <mons>       = 1*2DIGIT     ; "1".."12"
   <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
in rfc2445. The genralization consists in allowing a year in less than
4 digits and in allowing a prefixed "-" to represents years before 
S<1 BC>. More specifically, a I<ical> date string is defined by the
following ABNF specification (see rfc2234):

  <ical date>   = <year> <month> <day>
  <year>        = [<minus>] 1*DIGIT
  <month>       = 2DIGIT   ; "1".."12"
  <day>         = 2DIGIT   ; "1".."28" / "1".."29" /
                           ; "1".."30" / "1".."31" according 
                           ; to <month> <year> value
  <minus>       = %x2d

As it is customary, we use 0 to represent the year S<1 BC>, 
-1 to represent the year S<2 BC> and so on.



=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
used Augustus as name of the 8th month trought the module).


=head2 The Julian reform, leap years

To make up with the fact that the tropical year is a little longer than
365 days, Julius Caesar decreed that one year in 4 should be longer by
one day, adding one day to Februarius. 

Due to a misunderstandig about what "one year in 4" meant, between 
S<45 BC> and S<9 BC> there was a leap year every I<three> years. 
To make up for the surplus of leap years so introduced, emperor 
Augustus decreed a 15 years period without leap years, so that the 
first leap year after S<9 BC> was S<8 AD>. Then there was a leap 
year every 4 years until the Gregorian Reform. This module take into 
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

=item Kalendae

which was the first day of the month;

=item Idus

which was the 13th day of January, February, April, June, August,
September, November, and December and the 15th day of March, May,
July, or October;

=item Nonae

which was the 9th day befor the Idus (counting Idus itself as the
first day).

=back

The others days, where designed counting backward from these fixed
days. It should be remarked that, in counting backward, the romans
used an inclusive counting. That way, for instance,
the 2 Jan was the 4th day before the nones of January (the nones of
January being the 5th of January).

The day before a fixed day was designed by "pridie", abbreviated as
"p.d.". The other days was designed using the formula "ante diem",
abbreviated as "a.d.". For instance, the 16th of April was 
I<ante diem XVI Kalendas Maias>, abbreviated as I<a.d. Kal. Mai.>

In leap years, the supplemental day was obtained by counting two times
the 6th day before the Kalendae of March.

=head2 Counting the years

Romans counted years starting from the mitical foundation of Rome by
Romolus on 21st April, S<753 BC>. Fr instance, year S<2002 AD> 
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

Leo Cacciari, aka TheHobbit E<lt>thehobbit@altern.orgE<gt>

=head1 THANKS

I would like to thanks people who helped me to get this module right:

=over

=item *

The people on the datetime@perl.org mailing list, expecially Rich
Bowen E<lt>rbowen@rcbowen.comE<gt>, Elaine -HFB- Ashton
E<lt>elaine@chaos.wustl.eduE<gt> and Jean Forget
E<lt>J-FORGET@wanadoo.frE<gt>. 

=item *

The people on the iclp (it.comp.lang.perl) newsgroup, expecially Aldo
Calpini E<lt>dada@perl.itE<gt>.

=item *

Marco, aka `Diese|` from the #roma2 IRCnet channel, who helped me with
Latin. Any Latin error which is still there is mine, the ones that
went away did so thanks to him.


=back

=head1 COPYRIGHT AND  DISCLAIMER

This software is Copyright 2002 by Leo Cacciari.  This software is free
software; you can redistribute it and/or modify it under the terms of
the Perl Artistic License, either as stated in the enclosed LICENSE
file or (at your option) as given on the Perl home site: 
http://www.perl.com/language/misc/Artistic.html




=head2 Software documentation

=over

=item *

L<The perl(1) man page|perl(1)>.

=item *

L<The Roman(3) man page|Roman(3)>.

=item *

L<The Date::ICal(3) man page|Date::ICal(3)>.

=back



=head2 Books

Any Latin textbook.

=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



( run in 1.489 second using v1.01-cache-2.11-cpan-5a3173703d6 )