<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    DateTime::Format::Natural - Create machine readable date/time with
    natural parsing logic

SYNOPSIS
     use DateTime::Format::Natural;

     $parser = DateTime::Format::Natural-&gt;new;

     $dt = $parser-&gt;parse_datetime($date_string);
     @dt = $parser-&gt;parse_datetime_duration($date_string);

     if ($parser-&gt;success) {
         # operate on $dt/@dt, for example:
         printf("%02d.%02d.%4d %02d:%02d:%02d\n", $dt-&gt;day,
                                                  $dt-&gt;month,
                                                  $dt-&gt;year,
                                                  $dt-&gt;hour,
                                                  $dt-&gt;min,
                                                  $dt-&gt;sec);
     } else {
         warn $parser-&gt;error;
     }

DESCRIPTION
    "DateTime::Format::Natural" takes a string with a human readable
    date/time and creates a machine readable one by applying natural parsing
    logic.

METHODS
  new
    Creates a new "DateTime::Format::Natural" object. Arguments to "new()"
    are options and not necessarily required.

     $parser = DateTime::Format::Natural-&gt;new(
               lang          =&gt; 'en',
               format        =&gt; 'mm/dd/yy',
               prefer_future =&gt; '[0|1]'
               time_zone     =&gt; 'floating',
               daytime       =&gt; { morning   =&gt; 06,
                                  afternoon =&gt; 13,
                                  evening   =&gt; 20,
                                },
     );

    * "lang"
        Contains the language selected, currently limited to "en" (english).
        Defaults to '"en"'.

    * "format"
        Specifies the format of numeric dates, defaults to '"d/m/y"'.

    * "prefer_future"
        Turns ambigious weekdays/months to their futuristic relatives.
        Accepts a boolean, defaults to 0.

    * "time_zone"
        The time zone to use when parsing and for output. Accepts any time
        zone recognized by DateTime. Defaults to 'floating'.

    * "daytime"
        A hash consisting of specific hours given for peculiar daytimes.
        Daytimes may be selectively changed.

  parse_datetime
    Creates a "DateTime" object from a human readable date/time string.

     $dt = $parser-&gt;parse_datetime($date_string);
     $dt = $parser-&gt;parse_datetime(string =&gt; $date_string);

    * "string"
        The date string.

    Returns a DateTime object.

  parse_datetime_duration
    Creates one or more "DateTime" object(s) from a human readable date/time
    string which may contain timespans/durations. 'Same' interface &amp; options
    as "parse_datetime()", but must be explicitly called in list context.

     @dt = $parser-&gt;parse_datetime_duration($date_string);
     @dt = $parser-&gt;parse_datetime_duration(string =&gt; $date_string);

  success
    Returns a boolean indicating success or failure for parsing the
    date/time string given.

  error
    Returns the error message if the parsing didn't succeed.

  trace
    Returns a trace of methods which we're called within the Base class and
    a summary how often certain units were modified.

GRAMMAR
    The grammar handling has been rewritten to be easily extendable and
    hence everybody is encouraged to propose sensible new additions and/or
    changes.

    See the classes "DateTime::Format::Natural::Lang::[language_code]" if
    you're intending to hack a bit on the grammar guts.

EXAMPLES
    See the classes "DateTime::Format::Natural::Lang::[language_code]" for a
    overview of current valid input.

CREDITS
    Thanks to Tatsuhiko Miyagawa for the initial inspiration. See Miyagawa's
    journal entry &lt;http://use.perl.org/~miyagawa/journal/31378&gt; for more
    information.

    Furthermore, thanks to (in order of appearance) who have contributed
    valuable suggestions &amp; patches:

     Clayton L. Scott
     Dave Rolsky
     CPAN Author 'SEKIMURA'
     mike (pulsation)
     Mark Stosberg
     Tuomas Jormola
     Cory Watson
     Urs Stotz
     Shawn M. Moore
     Andreas J. König
     Chia-liang Kao
     Jonny Schulz
     Jesse Vincent
     Jason May

SEE ALSO
    DateTime, Date::Calc, &lt;http://datetime.perl.org&gt;

AUTHOR
    Steven Schubiger &lt;schubiger@cpan.org&gt;

LICENSE
    This program is free software; you may redistribute it and/or modify it
    under the same terms as Perl itself.

    See &lt;http://www.perl.com/perl/misc/Artistic.html&gt;

</pre></body></html>