in reply to How to calculate if today is before May 1
The DateTime distribution can help you:
use warnings; use strict; use DateTime; my ($month, $day) = (5, 1); my $now = DateTime->now; my $year = $now->year; my $known_date = DateTime->new( year => $year, month => $month, day => $day, ); if ($now < $known_date) { # do stuff }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to calculate if today is before May 1
by ikegami (Patriarch) on Dec 28, 2019 at 23:46 UTC |