DateTime::Format::Builder::Parser::Quick(3pm)

DateTime::Format::Builder::Parser::Quick3pm

Use another formatter, simply

Usage

    use DateTime::Format::Builder (
        parsers => {
            parse_datetime => [
                { Quick => 'DateTime::Format::HTTP' },
                { Quick => 'DateTime::Format::Mail' },
                { Quick => 'DateTime::Format::IBeat' },
            ]
        }
    );
    # is the same as
    use DateTime::Format::HTTP;
    use DateTime::Format::Mail;
    use DateTime::Format::IBeat;
    use DateTime::Format::Builder (
        parsers => {
            parse_datetime => [
                sub {
                    eval { DateTime::Format::HTTP->parse_datetime( $_[1] ) }
                },
                sub {
                    eval { DateTime::Format::Mail->parse_datetime( $_[1] ) }
                },
                sub {
                    eval { DateTime::Format::IBeat->parse_datetime( $_[1] ) }
                },
            ]
        }
    );

(These two pieces of code can both be found in the test suite; one as quick.t, the other as fall.t.)

Version

version 0.83

Overview

"Quick" adds a parser that allows some shortcuts when writing fairly standard and mundane calls to other formatting modules.

Specification

"Quick" has two keys, one optional.

The "Quick" keyword should have an argument of either an object or a class name. If it's a class name then the class is "use"d.

The "method" keyword is optional with a default of "parse_datetime". It's either name of the method to invoke on the object, or a reference to a piece of code.

In any case, the resultant code ends up looking like:

    my $rv = $Quick->$method($date);

Support

Bugs may be submitted at <https://github.com/houseabsolute/DateTime-Format-Builder/issues>.

I am also usually active on IRC as 'autarch' on "irc://irc.perl.org".

Source

The source code repository for DateTime-Format-Builder can be found at <https://github.com/houseabsolute/DateTime-Format-Builder>.

Releases

11 releases since Debian 4.0 (Etch); the text changed 6 times.

  1. 4.0
  2. 5.0–6.0
  3. 7
  4. 8–9
  5. 10
  6. 11–13
  7. Arch

Authors

•

Dave Rolsky <[email protected]>

•

Iain Truskett <[email protected]>

From perl-datetime-format-builder 1:0.83-8 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.