The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Apache2::WebApp::Plugin::DateTime - Plugin providing Date/Time methods

SYNOPSIS

  my $obj = $c->plugin('DateTime')->method( ... );     # Apache2::WebApp::Plugin::DateTime->method()

    or

  $c->plugin('DateTime')->method( ... );

DESCRIPTION

Common methods for dealing with Date/Time.

PREREQUISITES

This package is part of a larger distribution and was NOT intended to be used directly. In order for this plugin to work properly, the following packages must be installed:

  Apache2::WebApp
  Date::Calc
  Date::Format
  Date::Manip
  Params::Validate
  Time::ParseDate

INSTALLATION

From source:

  $ tar xfz Apache2-WebApp-Plugin-DateTime-0.X.X.tar.gz
  $ perl MakeFile.PL PREFIX=~/path/to/custom/dir LIB=~/path/to/custom/lib
  $ make
  $ make test
  $ make install

Perl one liner using CPAN.pm:

  $ perl -MCPAN -e 'install Apache2::WebApp::Plugin::DateTime'

Use of CPAN.pm in interactive mode:

  $ perl -MCPAN -e shell
  cpan> install Apache2::WebApp::Plugin::DateTime
  cpan> quit

Just like the manual installation of Perl modules, the user may need root access during this process to insure write permission is allowed within the installation directory.

OBJECT METHODS

days_between_dates

Return the total days between dates.

  my $date1 = 'Sun Oct 18 15:14:48 2009';     # then and
  my $date2 = localtime(time);                # now

  my $delta = $c->plugin('DateTime')->days_between_dates( $date1, $date2 );

format_time

Convert seconds-since-epoch to a human readable format.

  my $date = $c->plugin('DateTime')->format_time( $unix_time, '%a %b %d %T %Y' );

See Date::Format for character conversion specification.

SEE ALSO

Apache2::WebApp, Apache2::WebApp::Plugin, Date::Calc, Date::Format, Date::Manip, Params::Validate, Time::ParseDate

AUTHOR

Marc S. Brooks, <mbrooks@cpan.org> - http://mbrooks.info

COPYRIGHT

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://dev.perl.org/licenses/artistic.html