in reply to capture system date to $date

$date = localtime;
is the simplest, although you could also use
$date = `date`;
if you really wanted to (you might need to chomp that last one to get rid of the trailing \n).

Michael