News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Local Time setting for Forum, Calendar and "Link Event"

Started by stageducky, April 04, 2008, 07:22:32 AM

Previous topic - Next topic

Rumbaar

Yeah, never got a response when it was asked in the appropriate private section in regards to the 1.1.x stream of SMF.  So I'm unable to give a definitive answer.  Other than it appears to be not an issue in 2.x.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

kripz

Unless im doing something wrong, this bug is still here in 1.1.10.

Gavin Chatt

Regards
Gavin Chatt
Austeam Founder
http://austeamracing.com.au

JimM

Jim "JimM" Moore
Former Support Specialist

MrPhil

Something I haven't seen mentioned yet -- apparently MySQL doesn't pay any attention to PHP timezone settings. Supposedly, "now()" in SQL queries always returns or inserts the server's local time, rather than whatever timezone you set PHP to use. That might have some bearing on the problem if now() is involved and compared against some time in PHP. You would think that the timestamp stored in the database would be UTC (Unix epoch seconds count), but possibly it's having some offset added to correct to the server's timezone and DST rules?

Can anyone confirm this behavior of now()? I haven't looked through the code in detail, but I'm thinking that it might explain some of the really odd calendar-related behaviors seen here. If so, the solution may be to not use timedate fields, but to store PHP's time() value (UTC) as an integer (32 or 64 bit), and do formatting manually in PHP code. In calendar functions, you would take care to always compare raw timestamps (time() values) against each other, not time() vs now().

Anyway, worth pondering, if we're still looking for a solution...

JimM

Jim "JimM" Moore
Former Support Specialist

Advertisement: