Re: [PHP] Timezones and Daylight Savings Time
Hi, Friday, September 26, 2003, 2:55:51 AM, you wrote: JJ> Got a client site in Thailand that is about 13 hours JJ> different from the Web Server time so with any JJ> date/time stamping I need to add the 13 hours. JJ> However, when it comes time for DST, I'd hate to have JJ> to code for that or remember to manually change the JJ> time stamping. JJ> Is there some kind of automated function that JJ> determines the time zone of one location to another JJ> and stamps the correct time -- with or without DST? JJ> I guess otherwise you'd have to do something like: if >> Oct 31st and < April XX { time+12 } else { JJ> time+13 JJ> Obviously not the correct code but that's the idea. JJ> Am I off base here? Is there a simpler method or JJ> something I'm not thinking of? JJ> If the server was dedicated I would just fix the JJ> server time to be Thailand time, but it's a shared JJ> server and I can't do that. JJ> Thanks in advance! JJ> __ JJ> Do you Yahoo!? JJ> The New Yahoo! Shopping - with improved product search JJ> http://shopping.yahoo.com You could put this at the top of each page putenv('TZ=Asia/Bangkok'); That will correct all PHP functions, not sure about database times though -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Timezones and Daylight Savings Time
They want everything set to their time, so it would probably be easier just to determine the server time and add as necessary. I think... --- Jeff McKeon <[EMAIL PROTECTED]> wrote: > What if you set the server to use UTC and then used > the clients local > system setting to offset it for each client? > > So the server would have it's time at UTC and a > client in the Eastern US > would be at -4. You could then detect the web > client timezone setting > and adjust as needed? > > This is just a logic suggestion, I have no idea if > it's possible with > code but I would imagin it would be.. > > Jeff > > __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Timezones and Daylight Savings Time
What if you set the server to use UTC and then used the clients local system setting to offset it for each client? So the server would have it's time at UTC and a client in the Eastern US would be at -4. You could then detect the web client timezone setting and adjust as needed? This is just a logic suggestion, I have no idea if it's possible with code but I would imagin it would be.. Jeff > -Original Message- > From: J J [mailto:[EMAIL PROTECTED] > Sent: Thursday, September 25, 2003 12:56 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Timezones and Daylight Savings Time > > > Got a client site in Thailand that is about 13 hours > different from the Web Server time so with any > date/time stamping I need to add the 13 hours. > However, when it comes time for DST, I'd hate to have > to code for that or remember to manually change the > time stamping. > > Is there some kind of automated function that > determines the time zone of one location to another > and stamps the correct time -- with or without DST? > > > I guess otherwise you'd have to do something like: > if > Oct 31st and < April XX { time+12 } else { > time+13 > > Obviously not the correct code but that's the idea. > Am I off base here? Is there a simpler method or > something I'm not thinking of? > > If the server was dedicated I would just fix the > server time to be Thailand time, but it's a shared > server and I can't do that. > > Thanks in advance! > > > __ > Do you Yahoo!? > The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php