NAME

datecalc - Date calculator

VERSION

This document describes version 0.08 of datecalc (from Perl distribution App-datecalc), released on 2018-02-21.

SYNOPSIS

% datecalc

> today
2014-05-13#Tue

> tomorrow
2014-05-14#Wed

> today + 2 days
2014-05-15#Thu

> 2014-05-13 - 2014-02-14
P2M3W6D

> 2 months 3 weeks 6 days
P2M3W6D

> P10D
P1W3D

> 2014-05-13 + P2D
2014-05-15#Thu

> 2 * 2 days 10 hours
P4DT20H

> P10D / 2
P5D

> 6d + 8d + 13 min
P2WT13M

> month(today)
5

> days(P8D)
1
> weeks(P8D)
1
> P8D
P1W1D

DESCRIPTION

This is a command-line utility to perform date calculations.

For now, for more details, see App::datecalc.

FAQ

Why is date addition/subtraction with fractional duration incorrect?

For example:

> 2001-01-01 + P1.5M
2001-02-01#Thu

One would expect something closer to 2001-02-16. But this is how DateTime::Duration works. Instead of using fractions in larger units, try using smaller units instead. For example:

> 2001-01-01 + P1M2W
2001-02-15#Thu

FILES

~/.datecalc_history

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.

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.

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2018, 2016, 2015, 2014 by 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.