Catmandu::Fix::datetime_diff - Catmandu Fix to compute difference in seconds between two datetimes
datetime_diff('diff','startTime','endTime', 'start_pattern' => '%Y-%m-%d', 'end_pattern' => '%Y-%m-%d', 'start_time_zone' => 'UTC', 'end_time_zone' => 'Europe/Brussels', 'delete' => 1, validate => 0, start_locale => 'en_US', end_locale => 'nl_NL' )
Pattern of the start date string to parse. See DateTime::Format::Strptime for documentation of the format. The default is %FT%T.%NZ (UTC datetime string).
%FT%T.%NZ
Pattern of the end date string. See DateTime::Format::Strptime for documentation of the format. The default is %FT%T.%NZ (UTC datetime string).
Time zone of the start date string. In case the start 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.
Time zone of the end date string. In case the end 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.
Language code for the start 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 end 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.
Delete the key when either start or end date string cannot be parsed. When used, the option default is ignored. Disabled (0) by default.
default
0
Validate start and end 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.