http://qs321.pair.com?node_id=113469


in reply to Creating a string for a date stamp

i'd recommend sprintf here:
sub get_time_stamp() { my @tan=Today_and_Now(); my $stamp= sprintf '%d%02d%02d%02d%02d', @tan[0..4]; return $stamp; }
or the brief version:
sub get_time_stamp() { sprintf '%d%02d%02d%02d%02d', (Today_and_Now())[0..4]; }
this will keep all all the potential 1 or 2 digit fields padded with a zero. cheers, - danboo