htmanning has asked for the wisdom of the Perl Monks concerning the following question:
If the one year from now routine happens before the one week from now routine, it cancels out the one week from now routine. It is as if it is resetting NOW and I don't understand why.use DateTime::Duration (); my $one_year_from_now = $now->add( years=>1 ); if ($reservation_date > $one_year_from_now) { do something } and then use DateTime::Duration (); my $one_week_from_now = $now->add( weeks=>1 ); if ($reservation_date > $one_week_from_now) { do something }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DateTime issues
by haukex (Archbishop) on Apr 03, 2020 at 20:53 UTC | |
by htmanning (Friar) on Apr 03, 2020 at 20:56 UTC | |
|
Re: DateTime issues
by leszekdubiel (Scribe) on Apr 05, 2020 at 18:44 UTC | |
by haukex (Archbishop) on Apr 06, 2020 at 06:13 UTC |