![]() |
|
|
|||||||
| Register | Forum FAQ | Search | Today's Posts | Mark Forums Read |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
After discussing this further off-line, I have come to the conclusion that I believe it would always be best to handle any recording of time into MySQL as GMT. Then to simply let PHP handle the displaying of time into your intended time zone.
This would allow you to change the time zone domain wide by using the Apache directive. Then as Matt has pointed out and you have visitors that require the time to be displayed differently, you can override the default time zone set by Apache with PHP. As Mysql is concerned you can then make the adjustment on a per connection basis by setting the time zone to "0". I believe this would also aide in making your code more portable. This is my conclusion, any other thoughts or holes in my train of thought here?
__________________
Milwaukee Website Design Company |
|
||||
|
Well, yes, PHP uses server local time. You can obtain if local server time is in DST (call date('I')). As for MySQL - it depends on configuration. Check MySQL manual: A.4.6. Time Zone Problems.
However, from the PHP script you can't determine if (let's say the server is in Florida) if in New Ziland is used DST right now. See: About Daylight Saving Time. That is why many PHP applications have 'Use DST' in options (it simply adds 1 hour to the user timezone). JM, Scott, any comments? Very interesting situation arises, when user says his timezone is GMT +2 & he is in country that uses DST..... so what the current user time is? Anybody knows for sure? |
|
||||
|
Finally, after few hours of searching, found & tested a script. Seems working good:
Timezone and Daylight Saving Time Script However, I wasn't able to check many timezones... Have a look at it |
|
||||
|
From his site:
Quote:
Can anyone confirm or deny that the changes have already been made?
__________________
::::: 01001100 00110011 00110011 00110111 |