# Takes the time in seconds as an optional argument. # Returns the local date in yyyymmdd format. sub local_yyyymmdd { my $time = shift || time(); my ($year, $month, $mday) = (localtime($time))[5,4,3]; return 10_000*($year + 1900) + 100*($month + 1) + $mday; }