in reply to Getting "A.M." and "P.M." with localtime $time

You could use something like this...
#!/usr/bin/perl -w use strict; use POSIX qw|strftime|; my $time = strftime('%I:%M:%S %p', localtime(time() - 60 * 60 * 2)); print "$time\n";

Update: You didn't specify if the time was ahead or behind 2 hours. Just use time() + 60 * 60 * 2 if it's ahead.

Joshua