Q&A > dates and times > How to get time in seconds from localtime(time) to next 21st date of the month? contributed by poolpi
use POSIX ();
my ( $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst ) =
0, 0, 12, 21,
( $mday >= 21 ? ( ( $mon + 1 ) % 11 ) : $mon ),
( ( $mon == 11 and $mday >= 21 ) ? $year + 1 : $year )
POSIX::mktime( $sec, $min, $hour, $mday, $mon, $year )
By rote learning.
Via Genetic memory.
It's provided by my firmware.
I just remember them.
Thirty days hath September
My computer gets it right, usually.
I just ask someone else.
Someone punches me on the first of the month.
Results (100 votes),