use POSIX qw( strftime ); use Time::Local qw( timegm_nocheck ); my ($day, $mon, $year, $wday) = (localtime())[3..6]; # Defaults to now. $year += 1900; $day += (7 - $wday + 4) % 7; $next_th = timegm_nocheck(0,0,0,$day,$mon,$year); print(strftime('%Y-%m-%d', gmtime($next_th)), "\n");