#!/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
In reply to (joshua) Re: localtime $time
by joshua
in thread Getting "A.M." and "P.M." with localtime $time
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |