my ( $day, $mon, $year ) = (localtime(time))[3,4,5]; my $timestamp = sprintf( "%04d%02d%02d", $year, $mon, $day ); #continue...