Date-Components
view release on metacpan or search on metacpan
lib/Date/Components.pm view on Meta::CPAN
=item Comments:
- Handles all years, even negative years (aka BC)
- Years repeat in a standard 400 year cycle. This function
truncates the incoming year to the nearest multiple of 400 which
is defined by this program to be phase '0' of the 400 year cycle.
Thus, all values returned by this function are multiples of 400.
=item Examples:
get_global_year_cycle( -17); # returns -400
get_global_year_cycle(-801); # returns -1200
get_global_year_cycle( 1); # returns 0
get_global_year_cycle(1899); # returns 1600
get_global_year_cycle(1999); # returns 1600
get_global_year_cycle(2000); # returns 2000
get_global_year_cycle(2001); # returns 2000
=back
=back
=head1 DIAGNOSTICS
All functions comprehensively test input parameters BEFORE proceeding.
Functions of the C<is_valid_> type generally return an empty string, C<''>, for
invalid. Other functions first trap errors due to invalid input, report the
problem and then stop running.
A comprehensive set of tests is included in the distribution. C<Devel::Cover>
was used to achieve near complete code coverage. The only code not covered by
the tests, by design, are several else statements to trap unexpected else
conditions. Use the standard C<make test> to run.
=head1 DEPENDENCIES
warnings 1.05
version 0.74
Carp 1.04
Readonly 1.03
Readonly::XS 1.04
Test::More 0.74
Test::Manifest 1.22
Test::Pod 1.26
Test::Pod::Coverage 1.08
=head1 BUGS AND LIMITATIONS
All years, positive (AD) and negative (BC) are acceptable up to the integer
size on the host system. However, this range is B<NOT> historically accurate
before 1582AD. Thus, even though one can find the day of the week, for example
May 17, -273BC, by projecting backwards from today's standard, the date
is B<NOT> historically valid. Refer to the the Date::Calc module for further
explanation.
Date strings with truncated years such as '04' for '2004' will B<NOT> parse
correctly.
Note the correct fields within date strings of the various formats.
For example, the date string '4/8/2005' is interpreted as
'April 8, 2005', B<NOT> 'August 4, 2005'.
Startup is slow due to the one-time creation of a small hash table to speed up
subsequent look-ups.
=head1 SEE ALSO
B<Date::Calc>,
B<Date::Simple>,
B<Date::Manip>,
B<Class::Date>
For many others search for B<date> in CPAN
=head1 AUTHOR
David McAllister, E<lt>perldave@gmail.comE<gt>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2008 by David McAllister
Date::Components version 0.2.1
This program is free (or copyleft) software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License,
or (at your option) any later version. This software may be used in any
state or jurisdiction which does not prohibit the limitation or exclusion of
liability for loss or damage caused by negligence, breach of contract or
breach of implied terms, or incidental or consequential damages.
=head1 DISCLAIMER OF WARRANTY
This Program of Date::Components is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details. You should have received a copy of the GNU
General Public License along with this program.
If not, see http://www.gnu.org/licenses/.
( run in 3.108 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )