Date-Utility
view release on metacpan or search on metacpan
Returns Date::Utility object for the start of the current day. Much
faster than Date::Utility->new, as it will return the same object till
the end of the day.
plus_years
Takes the following argument as named parameter:
* years - number of years to be added. (Integer)
Returns a new Date::Utility object plus the given years. If the day is
greater than days in the new month, it will take the day of end month.
e.g.
print Date::Utility->new('2000-02-29')->plus_years(1)->date_yyyymmdd;
# will print 2001-02-28
minus_years
Takes the following argument as named parameter:
* years - number of years to be subracted. (Integer)
Returns a new Date::Utility object minus the given years. If the day is
greater than days in the new month, it will take the day of end month.
e.g.
print Date::Utility->new('2000-02-29')->minus_years(1)->date_yyyymmdd;
# will print 1999-02-28
plus_months
Takes the following argument as named parameter:
* years - number of months to be added. (Integer)
Returns a new Date::Utility object plus the given months. If the day is
greater than days in the new month, it will take the day of end month.
e.g.
print Date::Utility->new('2000-01-31')->plus_months(1)->date_yyyymmdd;
# will print 2000-02-28
minus_months
Takes the following argument as named parameter:
* years - number of months to be subracted. (Integer)
Returns a new Date::Utility object minus the given months. If the day
is greater than days in the new month, it will take the day of end
month. e.g.
print Date::Utility->new('2000-03-31')->minus_months(1)->date_yyyymmdd;
# will print 2000-02-28
create_trimmed_date
Takes the following argument as named parameter:
* year - calendar year of the date (Integer)
* month - calendar month of the date. (Integer)
* day - day of the month of the date. (Integer)
Returns a valid Date::Utility object whose date part is same with the
given year, month and day and time part is not changed. If the day is
greater than the max day in that month , then use that max day as the
day in the new object.
DEPENDENCIES
Moo
DateTime
POSIX
Scalar::Util
Time::Local
Syntax::Keyword::Try
AUTHOR
Binary.com, <support at binary.com>
BUGS
Please report any bugs or feature requests to bug-date-utility at
rt.cpan.org, or through the web interface at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Date-Utility. 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 Date::Utility
You can also look for information at:
* RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Date-Utility
* AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Date-Utility
* CPAN Ratings
http://cpanratings.perl.org/d/Date-Utility
* Search CPAN
http://search.cpan.org/dist/Date-Utility/
LICENSE AND COPYRIGHT
( run in 1.239 second using v1.01-cache-2.11-cpan-39bf76dae61 )