swa66 - 2:43 pm on Jun 20, 2013 (gmt 0)
Dealing with time:
I'm a firm believer of always using UTC (or GMT for those inclined to call it that) internally.And only use local time when dealing with users that you know the zimezone they're in for.
As far as mysql goes, I also believe it's better to translate the stored time into unix time and then process it instead of using pattern recognition - which is inherently tricky- as done in strtotime().
So instead of
SELECT field ...
SELECT UNIX_TIMESTAMP(field) ...
that way you get seconds since Jan 1st, 1970 as a number.
Also: it's not just php that knows about timezones, mysql does too!