#!/usr/bin/perl use strict; use warnings; use POSIX qw(strftime); my $dstamp = strftime("%Y%m%d", localtime(time)); my $tstamp = strftime("%H%M%S", localtime(time)); print "tstamp is $tstamp\n"; print "dstamp is $dstamp\n";