Date-Utility

 view release on metacpan or  search on metacpan

lib/Date/Utility.pod  view on Meta::CPAN

Returns a new L<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

=head2 minus_years

Takes the following argument as named parameter:

=over 4

=item * C<years> - number of years to be subracted. (Integer)

=back

Returns a new L<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

=head2 plus_months

Takes the following argument as named parameter:

=over 4

=item * C<years> - number of months to be added. (Integer)

=back

Returns a new L<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

=head2 minus_months

Takes the following argument as named parameter:

=over 4

=item * C<years> - number of months to be subracted. (Integer)

=back

Returns a new L<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

=head2 create_trimmed_date

Takes the following argument as named parameter:

=over 4

=item * C<year> - calendar year of the date (Integer)

=item * C<month> - calendar month of the date. (Integer)

=item * C<day> - day of the month of the date. (Integer)

=back

Returns a valid L<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.

=head1 DEPENDENCIES

=over 4

=item L<Moo>

=item L<DateTime>

=item L<POSIX>

=item L<Scalar::Util>

=item L<Time::Local>

=item L<Syntax::Keyword::Try>

=back

=head1 AUTHOR

Binary.com, C<< <support at binary.com> >>

=head1 BUGS

Please report any bugs or feature requests to C<bug-date-utility at rt.cpan.org>, or through
the web interface at L<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.

=head1 SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Date::Utility

You can also look for information at:

=over 4

=item * RT: CPAN's request tracker (report bugs here)

L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Date-Utility>

=item * AnnoCPAN: Annotated CPAN documentation

L<http://annocpan.org/dist/Date-Utility>

=item * CPAN Ratings

L<http://cpanratings.perl.org/d/Date-Utility>

=item * Search CPAN

L<http://search.cpan.org/dist/Date-Utility/>



( run in 0.796 second using v1.01-cache-2.11-cpan-39bf76dae61 )