DateTime::Format::Natural::EN - Create machine readable date/time with natural parsing logic
use DateTime::Format::Natural::EN; $parse = DateTime::Format::Natural::EN->new(); $dt = $parse->parse_datetime($date_string);
DateTime::Format::Natural::EN 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::EN
parse_datetime()
Creates a new DateTime::Format::Natural::EN object.
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, lang => 'en', debug => 1);
The options may contain the keys string, lang & 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. Finally, lang contains the language selected, currently limited to en (english) & ge (german).
string
lang
debug
en
ge
The string & lang options are necessary.
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.