DateTime::Moonpig is a thin wrapper around the DateTime module to fix problems
with that module's design. The main points are:
-
Methods for mutating
DateTime::Moonpigobjects in place have been overridden to throw a fatal exception. These includeadd_durationandsubtract_duration,set_* methods such asset_hour, andtruncate. -
The addition and subtraction operators have been overridden.
Adding a
DateTime::Moonpigto an integer n returns a newDateTime::Moonpigequal to a time n seconds later than the original. Similarly, subtracting n returns a newDateTime::Moonpigequal to a time n seconds earlier than the original.Subtracting two
DateTime::Moonpigs returns the number of seconds elapsed between them. It does not return an object of any kind. -
The
newmethod can be called with a single argument, which is interpreted as a Unix epoch time, such as is returned by Perl's built-intime()function. -
A few convenient methods have been added
BUGS
Please submit bug reports at https://github.com/mjdominus/DateTime-Moonpig/issues .
Please do not submit bug reports at http://rt.cpan.org/ .
LICENSE
Copyright 2010 IC Group, Inc.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
See the LICENSE file for a full statement of your rights under this
license.
AUTHOR
Mark Jason DOMINUS, mjd@cpan.org
Ricardo SIGNES, rjbs@cpan.org