Adam Wohld > Date-FromToday > Date::FromToday

Download:
Date-FromToday-0.05.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.05   Source  

NAME ^

Date::FromToday - Calculate the date in the past or future X days from today

VERSION ^

Version 0.05

SYNOPSIS ^

Date::FromToday is a Perl module for calculating a date in the past or future X number of days from today. It allows for custom formatting of the date string with month/day/year placement, seperators, leading zeros, month translation, forcing today's date, number of digits in the year.

    use Date::FromToday;

    my $date = Date::FromToday->new( move => -1 );

    #  prints yesterdays date in MM_DD_YYYY
    print $date->date_string;

-or-

    my $date = Date::FromToday->new(
        move => -1,
        month_translator => [
            qw(
                Jan Feb Mar Apr May June July Aug Sept Oct Nov Dec
            ),
        ],
        date_string_format => '{M}.{D}.{Y}',
        leading_zeros => 0,
        year_digits => 2,
    );

    #  prints yesterday's date looking like Jan.1.11
    print $date->date_string;

CONSTRUCTOR AND STARTUP ^

new()

Creates and returns Date::FromToday object.

    my $date = Date::FromToday->new( move => -1 );

Here are the parms for Date::FromToday

METHODS ^

day

Returns the calculated day, either numeric or translated from

month

Returns the calculated month

year

Returns the calculated year

date_string

Returns the date in a string as specified by the 'date_sting_format' param.

AUTHOR ^

Adam Wohld, <adam at spatialsystems.org>

BUGS ^

Please report any bugs or feature requests to bug-date-fromtoday at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Date-FromToday. 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::FromToday

You can also look for information at:

LICENSE AND COPYRIGHT ^

Copyright 2011 Adam Wohld.

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.

syntax highlighting: