use POSIX; my $timestamp = POSIX::strftime( "%y%m%d", localtime ); print "$timestamp\n";