NAME
Month::Simple - Simple month-based date arithmetics
VERSION
Version 0.02
SYNOPSIS
use Month::Simple;
my $month = Month::Simple->new();
my $prev = $month->prev;
my $stamp = $prev->first_second;
my $in_yr = $month->delta(12);
METHODS
new
Month::Simple->new(); # current month, using $^T as base
Month::Simple->new('2011-01');
Month::Simple->new('2011-01-02'); # day is ignored
Creates a new Month::Simple object. If no argument is provided, the current month (based on the startup of the script, i.e. based on $^T) is returned.
The argument can be a date in format YYYY-MM, YYYYMM, YYYY-MM-DD or a Date::Simple object. Days are ignored.
prev
Returns a new Month::Simple object for the month before the invocant month.
next
Returns a new Month::Simple object for the month after the invocant month.
delta(N)
Returns a new Month::Simple object. For positive N, it goes forward N months, and backwards for negative N.
first_second
Returns a UNIX timestamp for the first second of the month.
last_second
Returns a UNIX timestamp for the last second of the month.
first_day
Returns a Date::Simple object for the first day of the month.
AUTHOR
Moritz Lenz, <moritz.lenz at noris.de> for the noris network AG.
BUGS
Please report any bugs or feature requests to bug-month-simple at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Month-Simple. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Month::Simple
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
LICENSE AND COPYRIGHT
Copyright 2013 Moritz Lenz.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.