App-datecalc

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

    *   duration multiplication/division with a number

         P2D * 2
         2 * P2D

    *   extract elements from date

         year(2014-05-20)
         quarter(today)
         month(today)
         day(today)
         dow(today)
         doy(today)
         doq(today)
         wom(today)
         woy(today)
         hour(today)
         minute(today)
         second(today)

    *   extract elements from duration

         years(P22D)
         months(P22D)
         weeks(P22D)
         days(P22D)       # 1, because P22D normalizes to P3W1D
         totdays(P22D)    # 22
         days(P1M1D)      # 1
         totdays(P1M1D)   # 1, because months cannot be converted to days
         hours(P22D)
         minutes(P22D)
         seconds(P22D)

    *   some simple number arithmetics

         3+4.5
         2**3 * P1D
         abs(2-5)         # 3
         round(1.6+3)     # 5

    *   (NOT YET) date comparison

         today >= 2014-05-20

    *   (NOT YET) duration comparison

         P20D < P3W

METHODS
  new
  eval
HOMEPAGE
    Please visit the project's homepage at
    <https://metacpan.org/release/App-datecalc>.

SOURCE
    Source repository is at
    <https://github.com/perlancar/perl-App-datecalc>.

SEE ALSO
    DateTime and DateTime::Format::ISO8601, the backend modules used to do
    the actual date calculation.

    Marpa::R2 is used to generate the parser.

    Date::Calc another date module on CPAN. No relation except the
    similarity of name.

    <http://en.wikipedia.org/wiki/ISO_8601> for more information about the
    ISO 8601 format.

AUTHOR
    perlancar <perlancar@cpan.org>

CONTRIBUTORS
    *   Jeffrey Kegler <JKEGL@cpan.org>

    *   Steven Haryanto <stevenharyanto@gmail.com>

CONTRIBUTING
    To contribute, you can send patches by email/via RT, or send pull
    requests on GitHub.

    Most of the time, you don't need to build the distribution yourself. You
    can simply modify the code, then test via:

     % prove -l

    If you want to build the distribution (e.g. to try to install it locally
    on your system), you can install Dist::Zilla,
    Dist::Zilla::PluginBundle::Author::PERLANCAR,
    Pod::Weaver::PluginBundle::Author::PERLANCAR, and sometimes one or two
    other Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps
    required beyond that are considered a bug and can be reported to me.

COPYRIGHT AND LICENSE
    This software is copyright (c) 2023, 2018, 2016, 2015, 2014 by perlancar
    <perlancar@cpan.org>.

    This is free software; you can redistribute it and/or modify it under
    the same terms as the Perl 5 programming language system itself.

BUGS
    Please report any bugs or feature requests on the bugtracker website
    <https://rt.cpan.org/Public/Dist/Display.html?Name=App-datecalc>

    When submitting a bug or request, please include a test-file or a patch
    to an existing test-file that illustrates the bug or desired feature.



( run in 0.697 second using v1.01-cache-2.11-cpan-39bf76dae61 )