Forum Moderators: coopster
I've got a project that requires the local time (Philippine time) to show up on a clients site...as well as within a database. Right now when I reflect the "current date and time" on the clients site, it is relfected as US Mountian time which is accurate because the client's server space is in Utah.
How do I do this. It would be something like:
1. get GMT
2. get the gmt offset from Utah to the Philippines
3. convert GMT into current local date and time.
... is this correct?
So, if the GMT offset from Utah to the PI's is +16 (or whatever it is) how do I convert that result back into a "real date and time" format?
All help greatly appreciated.
Neophyte
Indeed you're right - I've considered agonizing over that very issue (daylight savings time vs. "standard time" in the states). The essence of this post concerned a customers server space which - as previously mentioned - is in Utah which is on Mountian time. I don't know if DST is in effect in this region of the US but I'll check tomorrow.
If it is - or atleast for the sake of making my function more flexible for additional projects - how DOES one go about allocating for the addition or subtraction of an hour?
I suppose the "chop-wood, carry-water" way would be to determine time zones of target areas where the time/date would be displayed, get the date, check it against a look-up list, and then adjust the offset (in seconds) to accommodate accordingly. Yuck.
Is there an easier way?
Neophyte