in reply to Yesterday's date
I would be using Time::Piece for this since it is in core.
#!/usr/bin/env perl use strict; use warnings; use Time::Piece; my $t = Time::Piece->strptime ($ARGV[0], '%d/%m/%Y'); printf "Date as supplied: %s\n", $t->dmy ('/'); $t = $t - 86400; printf "Date minus one day: %s\n", $t->dmy ('/');
$ ./yesterday.pl 01/12/2022 Date as supplied: 01/12/2022 Date minus one day: 30/11/2022 $
🦛
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Yesterday's date
by Corion (Patriarch) on May 28, 2023 at 13:47 UTC | |
by hippo (Archbishop) on May 28, 2023 at 14:20 UTC | |
by Corion (Patriarch) on May 28, 2023 at 14:42 UTC | |
by hippo (Archbishop) on May 28, 2023 at 15:02 UTC | |
by ikegami (Patriarch) on May 31, 2023 at 14:56 UTC | |
by choroba (Cardinal) on May 28, 2023 at 20:02 UTC | |
by ikegami (Patriarch) on May 31, 2023 at 14:50 UTC | |
|
Re^2: Yesterday's date
by kcott (Archbishop) on May 29, 2023 at 04:05 UTC | |
by parv (Parson) on May 29, 2023 at 20:12 UTC | |
by kcott (Archbishop) on May 30, 2023 at 07:48 UTC |