Date::Piece

Date::Piece is a Perl module that offers efficient dates with Time::Piece interoperability.
Download

Date::Piece Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Eric L. Wilhelm
  • Publisher web site:
  • http://search.cpan.org/~ewilhelm/Date-Piece-v0.0.2/lib/Date/Piece.pm

Date::Piece Tags


Date::Piece Description

Date::Piece is a Perl module that offers efficient dates with Time::Piece interoperability. Date::Piece is a Perl module that offers efficient dates with Time::Piece interoperability.SYNOPSIS use Date::Piece qw(date); my $date = date('2007-11-22'); my $time = $date->at('16:42:35'); print $time, "n"; # is a Time::PieceYou can also start from a Time::Piece object. use Time::Piece; use Date::Piece; my $time = localtime; my $date = $time->date; # also ymd() $date+=7; # seven days later print $date, "n"; # seven days later at the original time print $date->at($time), "n";This module allows you to do nominal math on dates. That is, rather than worrying about time zones and DST while adding increments of 24*60**2 seconds to a date&time object, you simply discard the time component and do math directly on the date. If you need a time-of-day on the calculated date, the at() method returns a Time::Piece object, thus allowing you to be specific about the endpoints of a nominal interval.This is useful for constructs such as "tomorrow", "yesterday", "this time tomorrow", "one week from today", "one month later", "my 31st birthday", and various other not-necessarily-numeric intervals on the arbitrary and edge-case-laden division of time known by most earthlings as "the calendar." That is, adding days or months is analogous to counting squares or turning pages on a calendar.This module extends Date::Simple and connects it to Time::Piece. See Date::Simple for more details.Requirements:· Perl Requirements: · Perl


Date::Piece Related Software