App-DateUtils
view release on metacpan or search on metacpan
script/parse-date-using-df-flexible view on Meta::CPAN
#!perl
# Note: This script is a CLI for Riap function /App/DateUtils/parse_date_using_df_flexible
# and generated automatically using Perinci::CmdLine::Gen version 0.502
use 5.010001;
use strict;
use warnings;
use Perinci::CmdLine::Any;
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2024-03-07'; # DATE
our $DIST = 'App-DateUtils'; # DIST
our $VERSION = '0.128'; # VERSION
my $cmdline = Perinci::CmdLine::Any->new(
url => "/App/DateUtils/parse_date_using_df_flexible",
program_name => "parse-date-using-df-flexible",
read_config => 0,
read_env => 0,
);
$cmdline->run;
# ABSTRACT: Parse date string(s) using DateTime::Format::Flexible
# PODNAME: parse-date-using-df-flexible
__END__
=pod
=encoding UTF-8
=head1 NAME
parse-date-using-df-flexible - Parse date string(s) using DateTime::Format::Flexible
=head1 VERSION
This document describes version 0.128 of parse-date-using-df-flexible (from Perl distribution App-DateUtils), released on 2024-03-07.
=head1 SYNOPSIS
B<parse-date-using-df-flexible> B<L<--help|/"--help, -h, -?">> (or B<L<-h|/"--help, -h, -?">>, B<L<-?|/"--help, -h, -?">>)
B<parse-date-using-df-flexible> B<L<--version|/"--version, -v">> (or B<L<-v|/"--version, -v">>)
B<parse-date-using-df-flexible> [B<L<--format|/"--format=s">>=I<name>|B<L<--json|/"--json">>] [B<L<--lang|/"--lang=s">>=I<str>] [B<L<--(no)naked-res|/"--naked-res">>] [B<L<--page-result|/"--page-result">>[=I<program>]|B<L<--view-result|/"--view-resul...
See examples in the L</EXAMPLES> section.
=head1 OPTIONS
C<*> marks required options.
=head2 Main options
=over
=item B<--date>=I<s@>*
(No description)
Can also be specified as the 1st command-line argument and onwards.
Can be specified multiple times.
=item B<--dates-json>=I<s>
See C<--date>.
Can also be specified as the 1st command-line argument and onwards.
=item B<--lang>=I<s>
Default value:
"en"
Valid values:
["de","en","es"]
=item B<--time-zone>=I<s>, B<--timezone>
(No description)
=back
=head2 Output options
=over
script/parse-date-using-df-flexible view on Meta::CPAN
=back
=head2 Other options
=over
=item B<--help>, B<-h>, B<-?>
Display help message and exit.
=item B<--version>, B<-v>
Display program's version and exit.
=back
=head1 COMPLETION
This script has shell tab completion capability with support for several
shells.
=head2 bash
To activate bash completion for this script, put:
complete -C parse-date-using-df-flexible parse-date-using-df-flexible
in your bash startup (e.g. F<~/.bashrc>). Your next shell session will then
recognize tab completion for the command. Or, you can also directly execute the
line above in your shell to activate immediately.
It is recommended, however, that you install modules using L<cpanm-shcompgen>
which can activate shell completion for scripts immediately.
=head2 tcsh
To activate tcsh completion for this script, put:
complete parse-date-using-df-flexible 'p/*/`parse-date-using-df-flexible`/'
in your tcsh startup (e.g. F<~/.tcshrc>). Your next shell session will then
recognize tab completion for the command. Or, you can also directly execute the
line above in your shell to activate immediately.
It is also recommended to install L<shcompgen> (see above).
=head2 other shells
For fish and zsh, install L<shcompgen> as described above.
=head1 EXAMPLES
=head2 Example #1
% parse-date-using-df-flexible '23rd Jun'
+----------------------------+----------+--------------+------------+---------------------+---------------------------+------------------------+
| module | original | is_parseable | as_epoch | as_datetime_obj | as_datetime_obj_tz_local | as_datetime_obj_tz_utc |
+----------------------------+----------+--------------+------------+---------------------+---------------------------+------------------------+
| DateTime::Format::Flexible | 23rd Jun | 1 | 1719100800 | 2024-06-23T00:00:00 | 2024-06-23T00:00:00+07:00 | 2024-06-22T17:00:00Z |
+----------------------------+----------+--------------+------------+---------------------+---------------------------+------------------------+
=head2 Example #2
% parse-date-using-df-flexible '23 Dez' --lang de
+--------------------------------+----------+--------------+------------+---------------------+---------------------------+------------------------+
| module | original | is_parseable | as_epoch | as_datetime_obj | as_datetime_obj_tz_local | as_datetime_obj_tz_utc |
+--------------------------------+----------+--------------+------------+---------------------+---------------------------+------------------------+
| DateTime::Format::Flexible(de) | 23 Dez | 1 | 1734912000 | 2024-12-23T00:00:00 | 2024-12-23T00:00:00+07:00 | 2024-12-22T17:00:00Z |
+--------------------------------+----------+--------------+------------+---------------------+---------------------------+------------------------+
=head2 Example #3
% parse-date-using-df-flexible foo
+----------------------------+----------+--------------+------------------------------------------------------------------------------------------------------------------------------+
| module | original | is_parseable | error_msg |
+----------------------------+----------+--------------+------------------------------------------------------------------------------------------------------------------------------+
| DateTime::Format::Flexible | foo | 0 | Invalid date format: foo at /home/u1/perl5/perlbrew/perls/perl-5.38.2/lib/site_perl/5.38.2/Perinci/CmdLine/POD.pm line 505. |
+----------------------------+----------+--------------+------------------------------------------------------------------------------------------------------------------------------+
=head1 HOMEPAGE
Please visit the project's homepage at L<https://metacpan.org/release/App-DateUtils>.
=head1 SOURCE
Source repository is at L<https://github.com/perlancar/perl-App-DateUtils>.
=head1 AUTHOR
perlancar <perlancar@cpan.org>
=head1 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 L<Dist::Zilla>,
L<Dist::Zilla::PluginBundle::Author::PERLANCAR>,
L<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.
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2024, 2021, 2020, 2019, 2017, 2016, 2015 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.
=head1 BUGS
Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=App-DateUtils>
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.
=cut
( run in 0.846 second using v1.01-cache-2.11-cpan-39bf76dae61 )