Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding Current time...

Status
Not open for further replies.

perlone

Programmer
Joined
May 20, 2001
Messages
438
Location
US
Hello,

I'm running a game site and I need to reset the server by finding the current Central Time. I used the following code, but this one only find the local time and it goes by your computer time:

my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);

I need to find Central Time. Anybody knows?
 
there's a time module on cpan that has a function called gmtime() (I think) that returns (what else) Greenwich Mean Time. Central time can be figured from that by subtracting from that the standard difference between GMT and Central. (I think it's eight hours, but that's probably not right.) Brad Gunsalus
Cymtec Systems, Inc.
bgunsalus@cymtec.com
 
if you use gmtime instead of localtime, it will give you the same values adjusted for GMT. Then you can adjust them to central time.
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top