SYNOPSIS Use English: use DateTime::Format::Alami::EN; my $parser = DateTime::Format::Alami::EN->new(); my $dt; $dt = $parser->parse_datetime("2 hours 13 minutes from now"); $dt = $parser->parse_datetime("yesterday"); use Indonesian: use DateTime::Format::Alami::ID; my $parser = DateTime::Format::Alami::ID->new(); my $dt; $dt = $parser->parse_datetime("5 jam lagi"); $dt = $parser->parse_datetime("hari ini"); DESCRIPTION EARLY RELEASE: PROOF OF CONCEPT ONLY AND VERY VERY INCOMPLETE. This class parses human/natural date/time string and returns DateTime object. Currently it supports English and Indonesian. The goal of this module is to make it easier to add support for other human languages. It works by matching date string with a bunch of regex patterns (assembled from p_* methods, e.g. p_today, p_dur_ago, p_dur_later, and so on). If a pattern is found, the corresponding a_* method is called to compute the DateTime object (e.g. if p_today pattern matches, a_today is called). To actually use this class, you must use one of its subclasses for each human language that you want to parse. There are already some other DateTime human language parsers on CPAN and elsewhere, see "SEE ALSO". ADDING A NEW HUMAN LANGUAGE TBD METHODS new => obj Constructor. You actually must instantiate subclass instead. parse_datetime($str) => obj Parse date/time expression in $str and return DateTime object. Return undef if expression cannot be parsed. FAQ What does "alami" mean? It is an Indonesian word, meaning "natural". SEE ALSO Similar modules on CPAN DateTime::Format::Natural. You probably want to use this instead, unless you want something other than English. I did try to create an Indonesian translation for this module a few years ago, but gave up. Perhaps I make another attempt. Other modules on CPAN DateTime::Format::Human deals with formatting and not parsing. Similar non-Perl libraries Natt Java library, which the last time I tried sometimes gives weird answer, e.g. "32 Oct" becomes 1 Oct in the far future. http://natty.joestelmach.com/ Duckling Clojure library, which can parse date/time as well as numbers with some other units like temperature. https://github.com/wit-ai/duckling