use POSIX 'strftime'; my $format = '%I:%M:%S %p - %a, %B %d, %Y' . "\n"; my @time = localtime (time); print strftime ($format, @time);