http://qs321.pair.com?node_id=137951


in reply to Time Zones and Users

At my company, we run several instances of a scheduler program all around the world. All any of them care about is 'what is my local time?'. The user makes the adjustment. For instance, I'm in Minneapolis, MN and the scheduler that I'm looking at is in Sydney, Australia. I have to keep track of the time difference (right now, it is 17 hours I think). I think that this is the way to go. If you will be doing anything local to the server, you should be doing everything on the servers time.

Of course, if it really matters to you, you could do some version of an rsh to the remote server to execute a timelocal((localtime())[0,1,2,3,4,5]) and store it in a variable. Do the same thing on the client side, and find the difference between the two. Pass the difference into gmtime to get the difference in hours and minutes (not all timezones are an integer number of hours apart, so the minutes are necessary).

thor