CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
Frustrated With Time Zones



Jun 25, 2000, 10:23 AM

Post #1 of 4 (1366 views)
Frustrated With Time Zones Can't Post


I need an easier way to convert time to different time zones. I'm using the local time function and I'm in the pacific time zone. I need all of my times to by in the Eastern (et) time zone. I have no problem converting my local hour times to et time but for the days I'd rather have an easier way. The hour conversions were hard enough in my situation.

In know that you can get the time function to use gmt time, can you get it to do eastern (et) time?

Thank You Very Much,

I really Need Help with this one. Smile



Jun 25, 2000, 2:57 AM

Post #2 of 4 (1366 views)
Re: Frustrated With Time Zones [In reply to] Can't Post

Have you tried changing the timezone environment variable before using localtime() ?
Or simply use localtime(time() - 3 * 3600) - or whatever the time difference is between your server time and Eastern time.


Jun 25, 2000, 4:05 PM

Post #3 of 4 (1366 views)
Re: Frustrated With Time Zones [In reply to] Can't Post


Ok, That works but it's only 3:12 pm here, I'm using the hours from the time function so it 15 hours military time. That's the way it prints the time for the hours when I do this.

(@time) = localtime(time);
print "It is $time[2]";

It Is "15"

When I use your code it prints "18" instead of "15". That's right.

But when it's 10:00 pm here and 1:00 am on the east coast. That's 22 and 1 in military time. Will the perl recognize that it's 1 when it adds three to the time of 22 or will it just add three to equal 25.




Jun 25, 2000, 9:28 PM

Post #4 of 4 (1366 views)
Re: Frustrated With Time Zones [In reply to] Can't Post

Thanks TheGame+,

It's 10:00 pm and when it added the 3 hours it change the time to 1 (Military Time).

The day also changed accordingly.

Thanks Smile



Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives