in reply to How to calculate if today is before May 1
Hi, this: "if TODAY is before May 1 every year" is not clear to me.
Thinking about those aspects of your question should help lead to you to right solution.
(You can easily get today's date in ISO format with the core module Time::Piece: $now = Time::Piece->new->datetime;)my $d2 = "2019-12-29T12:34:56"; my $d1 = "2019-05-01T00:00:00"; say ($d2 lt $d1 ? "before" : "on or after");
Hope this helps!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to calculate if today is before May 1
by htmanning (Friar) on Dec 29, 2019 at 20:55 UTC | |
by afoken (Chancellor) on Dec 30, 2019 at 09:28 UTC |