my $current_hour = (localtime)[2]; my $yesterday_around_noon = localtime(time - ($current_hour + 12) * 3600);