Date::Formatter

Date::Formatter Perl module is a simple Date and Time formatting object.
Download

Date::Formatter Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Stevan Little and Rob Kinyon
  • Publisher web site:
  • http://search.cpan.org/~stevan/

Date::Formatter Tags


Date::Formatter Description

Date::Formatter Perl module is a simple Date and Time formatting object. Date::Formatter Perl module is a simple Date and Time formatting object.SYNOPSIS use Date::Formatter; # create a Date::Formatter object with the current date and time. my $date = Date::Formatter->now(); # create a formatter routine for this object # see formatter mini-language documentation below $date->createDateFormatter("(hh):(mm):(ss) (MM)/(DD)/(YYYY)"); print $date; # print date in this format -> 12:56:03 4/12/2004 # get the formatter for use with other objects my $formatter = $date->getDateFormatter(); # create an interval of time my $interval = Date::Formatter->createTimeInterval(years => 1, days => 2, minutes => 15); # re-use the formater from above $interval->setDateFormatter($formatter); print $interval; # print date in this format -> 12:56:03 4/12/2004 # use overloaded operators my $future_date = $date + $interval; # sort the dates (again with the overload operator) my @sorted_dates = sort { $a $b } ($date, $interval, $future_date);This module provides a fast and very flexible mini-language to be used in formatting dates and times. In order to make that useful though, we had to make a fully functioning date & time object. This object looks and smells much like the Java and Javascript Date object on purpose. We also overloaded a number of operators to allow date addition and subtraction as well as comparisons.Requirements:· Perl Requirements: · Perl


Date::Formatter Related Software