generate a timestamp.
This timestamp is then used to identify all test artifacts including
screen captures as well as log and test files produced during the test
The example below is how I implemented it. Basically I wrote a perl
sub that does this work for me and I call it from any of my scripts.
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year += 1900;
return $year . sprintf('%02u%02u_%02u%02u%02u', $mon, $mday, $hour, $min, $sec);
Handy timestamp subroutine. Returns formatted timestamp:
my $unique_filename = 'filename_' . get_timestamp() . '.out';
will create a file named filename_20100915_144955.out
Please NOTE that formatted means formatted for my needs; to change
displayed timestamp format, manipulate sprintf as needed.