DateTime::Format::Natural - Create machine readable date/time with natural parsing logic
use DateTime::Format::Natural; $parse = DateTime::Format::Natural->new(); $dt = $parse->parse_datetime($date_string);
DateTime::Format::Natural consists of a method, parse_datetime(), which takes a string with a human readable date/time and creates a machine readable one by applying natural parsing logic.
DateTime::Format::Natural
parse_datetime()
Creates a new DateTime::Format::Natural object.
$parse = DateTime::Format::Natural->new(lang => '[en|de]');
lang contains the language selected, currently limited to en (english) & de (german).
lang
en
de
Creates a DateTime object from a human readable date/time string.
DateTime
$dt = $parse->parse_datetime($date_string); $dt = $parse->parse_datetime(string => $date_string, debug => 1);
The options may contain the keys string, & debug. string may consist of the datestring, whereas debug holds the boolean value for the debugging option. If debugging is enabled, each token that is analysed will be output to stdout with a trailing newline.
string
debug
The string parameter is required.
Returns a DateTime object.
See the modules DateTime::Format::Natural::Lang::* for a overview of valid input.
DateTime::Format::Natural::Lang::*
Not implemented yet.
DateTime, Date::Calc, http://datetime.perl.org/
Steven Schubiger <schubiger@cpan.org>
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
To install DateTime::Format::Natural, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DateTime::Format::Natural
CPAN shell
perl -MCPAN -e shell install DateTime::Format::Natural
For more information on module installation, please visit the detailed CPAN module installation guide.