Catmandu::Fix::datetime_format - Catmandu Fix for converting between datetime formats
datetime_format( 'timestamp', 'source_pattern' => '%s', 'destination_pattern' => '%Y-%m-%d', 'time_zone' => 'UTC', 'set_time_zone' => 'Europe/Brussels', 'delete' => 1, validate => 0, locale => 'en_US', set_locale => 'nl_NL' )
Pattern of the source date string to parse. See DateTime::Format::Strptime for documentation of the format. The default is %s (Unix timestamp).
%s
Pattern of the destination date string. This is the way your datetime needs to be formatted. The default is %FT%T.%NZ (UTC timestamp).
%FT%T.%NZ
Time zone of the source date string. In case the source date string does not contain any time zone information, the parser will use this time_zone to interpret the date. When not set correctly, the resulting date string will be wrong. The default value is UTC. For a complete list of time zone codes see http://en.wikipedia.org/wiki/List_of_tz_database_time_zones.
UTC
Most parsers assume 'local', but this can lead to different results on different systems. 'local' simply means the same time zone as the one configured on your system.
Reset the time zone for the destination string. This is usefull for converting dates between time zones, e.g. Europe/Brussels. The default value is UTC.
Europe/Brussels
Language code for the source date string. This is only important when your date string contains names of week days or months. For a complete list of locale codes see DateTime::Locale::Catalog. The default value is en_US.
en_US
Language code for the destination date string. This is only important when your destination date string contains codes for names of week days or months (%a, %A, %b, %B, and %h). This is usefull for converting dates between languages. For a complete list of locale codes see DateTime::Locale::Catalog. The default value is en_US.
%a
%A
%b
%B
%h
Delete the key when the source date string cannot be parsed. When used, the option default is ignored. Disabled (0) by default.
default
0
Set the value of the destination string to this value, when parsing fails. By default both the options delete and default are not set, which means that the destination date string will not be created. Not set (undef) by default.
delete
undef
Validate source date string when parsing. Disabled (0) by default to increase speed.
Nicolas Franck, <nicolas.franck at ugent.be>
<nicolas.franck at ugent.be>
Catmandu::Fix
To install Catmandu::Fix::Date, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catmandu::Fix::Date
CPAN shell
perl -MCPAN -e shell install Catmandu::Fix::Date
For more information on module installation, please visit the detailed CPAN module installation guide.