Myco::Util::DateTime - a Myco entity class
$Revision: 1.1.1.1 $
$Date: 2003/12/18 21:18:30 $
use Myco; # Constructors. See Myco::Base::Entity for more. my $obj = Myco::Util::DateTime->new; # Accessors. my $value = $obj->get_fooattrib; $obj->set_fooattrib($value); $obj->save; $obj->destroy;
Blah blah blah... Blah blah blah... Blah blah blah... Blah blah blah blah blah... Blah blah...
Constructor, accessors, and other methods -- as inherited from Myco::Base::Entity.
$datetime->date('YYYY-MM-DD');
Get the current date, in several formats: YYYY-MM-DD, YY-MM-DD, MM-DD-YYYY, MM-DD-YY.
my $year = $datetime->year;
Get the current year.
my $month = $datetime->month;
Get the current Month.
my $day = $datetime->day;
Get the current day of the month.
$datetime->date_add($offset, $date1);
Adds an integer (positive or negative) offset to a given date. If no date is given, then the current date is used.
my @range = $datetime->date_range('2002-06-01', '2003-06-01'); or my @range = $datetime->date_range(-365, '2003-06-01'); or my @range = $datetime->date_range(-365);
Returns the range of dates between two given dates (including both). Alternatively, adds an integer (positive or negative) offset to a given date and returns an array of dates for each intervening day. Starts with the most recent, and descends or ascends from there. If no date is given, the current date is used.
my @american_dates = $datetime->american( @dates ); my $isa_american_date = $american_dates[0] eq 'June 16th, 2003';
Translates ISO-format dates into an American-style dates.
To install Myco, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Myco
CPAN shell
perl -MCPAN -e shell install Myco
For more information on module installation, please visit the detailed CPAN module installation guide.