PHP help: getting time in different time zones

timelapse

Senior member
Nov 7, 1999
401
0
0
Hello, I am trying to write a script that will return the time difference between two locations in the world. My problem is handling the Daylight Saving Time modifications to clocks in just some areas in the world, since not everybody uses it, and also the dates in which the changes take place are different. I have searched on google for the last few days, and I have to say I am very confused about how to do what I want. It seems some solutions only work on Unix servers due to some functions that do not work right on windows, and each solution I have seen uses a different time standard: UTC, GMT, DST, etc...

I just want to know if someone here has had the same problem and if they know of an existing solution or a straightforward way to solve it. I don't really care what method is used, I just want to have the time right for any location on Earth :)

Thanks in advance!
 

DGath

Senior member
Jul 5, 2003
417
0
0
I only know the basic concepts behind php, however I do have some programming experience in C++ & Java. If I were trying to write that program in C++ or Java, the only way I could think of is having each time zone have it's own location that the user would select. Each location would then have it's own attributes. Been a few years, but easiest way would be to use classes. I just looked at the windows clock settings and there is probably ~50 different time zones. Good luck.

Bottom line is I don't think there is an easy way around this. But I'm far from the programming expert, been a few years since I touched the non-html stuff.