DateTimeX::Format::CustomPattern - A Moose::Role for building DateTime Formats that require patterns
It adds an attribute "pattern", and behavies consistant with the call-overriding environment of DateTimeX::Format.
package DateTimeX::Format::RequiresPattern; use Moose; with 'DateTimeX::Format::CustomPattern'; package main; my $dt = DateTimeX::Format::RequiresPattern->new({ locale => $locale , time_zone => $timezone , pattern => '%H:%M:%S' , debug => 0|1 , defaults => 0|1 }); $dt->parse_datetime( $time, {pattern => '%H:%M'} );
All of these slots correspond to your object environment: they can be supplied in the constructor, or through accessors.
pattern( $str )
Can be overridden in the call to ->parse_datetime.
To install DateTimeX::Format, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DateTimeX::Format
CPAN shell
perl -MCPAN -e shell install DateTimeX::Format
For more information on module installation, please visit the detailed CPAN module installation guide.