use POSIX qw[strftime]; my $days = 30; my $newExpiration = strftime('%Y%m%d', localtime(time + 60 * 60 * 24 * $days));