in reply to Re: Yesterday's date
in thread Yesterday's date
Note that this approach will have a problem for those days with less than 24 hours (like when switching between normal and daylight savings time.
I prefer the approach to iteratively subtract 22 hours until the (stringified) date changes:
... my $res = $t - 22*60*60; while( $res->ymd('-') eq $t->ymd('-') ) { $res -= 22*60*60; } return $res
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Yesterday's date
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 | |
|
Re^3: Yesterday's date
by choroba (Cardinal) on May 28, 2023 at 20:02 UTC | |
|
Re^3: Yesterday's date
by ikegami (Patriarch) on May 31, 2023 at 14:50 UTC |