Created
August 25, 2021 09:42
-
-
Save reneeb/64850a3c2dc8f6b0f8d26747760b7b6f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reneeb@host:~$ perl -MDateTime -E 'my $month; my $date = DateTime->new(day=> 7, month=>11, year=>2021); $date->month() < 10 ? $month = $date->month() : $month = "0" . $date->month(); say $month' | |
011 | |
reneeb@host:~$ perl -MDateTime -E 'my $month; my $date = DateTime->new(day=> 7, month=>8, year=>2021); $date->month() < 10 ? $month = $date->month() : $month = "0" . $date->month(); say $month' | |
08 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment