-
-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Description
I just found out that you can use %- to strip leading zeros, e.g.
$ date +%Y/%-m/%d
2019/1/16
Unfortunately, this is not supported by DateTime::Format::Strptime:
use DateTime::Format::Strptime qw(strftime);
my $date = DateTime::Format::Strptime->new(
pattern => "%Y/%-m/%d",
on_error => "croak",
);
my $p = $date->parse_datetime("2015/5/30");
print strftime("%F", $p), "\n" if $p;
Metadata
Metadata
Assignees
Labels
No labels