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 L<http://search.cpan.org/~drolsky/DateTime-Format-Strptime-1.56/lib/DateTime/Format/Strptime.pm> for documentation Default: '%s' (unix timestamp)
pattern of the destination date string. This is the way your datetime needs to be formatted. Default: '%FT%T.%NZ' (UTC timestamp)
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. For a complete list of time zone codes see L<http://en.wikipedia.org/wiki/List_of_tz_database_time_zones>. Default: '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' Default: 'UTC'
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 L<DateTime::Locale::Catalog>. Default: 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 L<DateTime::Locale::Catalog>. Default: en_US
Delete the key when the source date string cannot be parsed. When used, the option 'default' is ignored. Default: 0
Set the value of the destination string to this value, when parsing fails. Default: undef By default both the options 'delete' and 'default' are not set, which means that the destination date string will not be created.
Validate source date string when parsing. Set this to zero to increase speed. Default: 0
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.