On Tue, 30 Sep 2003 23:57:16 -0500, David Gilden [EMAIL PROTECTED] wrote:
Quick question,
the server is on west coast time (California)
client is in Texas, central time (+2 hours)
How can I add two hours to offset for central time?
Thx,
Dave
#!/usr/local/bin/perl
use POSIX 'strftime';
my $date = strftime('%A, %B %d, %Y %I:%M %p',localtime);
print $date;
As fliptop said modules are groovy for this kind of thing, but if your needs aren't to
great, you can use the old standby of adding the number of seconds in 2 hours to the
time provided by 'time' which is the default to 'localtime'...
localtime( time() + (2*60*60) )
Of course for those of us in the back asswards state of Indiana or I suppose the rest
of the world, this only works half the time when talking to someone that is in the
other sets which is why a robust module is usually better at this kind of thing.
http://danconia.org
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]