Yeah, I had that problem too, I'm in the UK, but my server is in the
USA under EST.
My posts were being moved 5 hours forwards in time after applying
the hack - which was both insanely annoying and totally impractical.
After three hours poring over PHP and nearly going insane trying to
work out what doing what to which (time stuff is a nightmare) I
finally arrived at a very dirty little hack that fixed it.
WARNING:This is a hack-in-progress and is a very
nasty cludge - so be warned that this is not (yet) an elegant
Here's what I did: Open up story.php (in your admin directory) and
search for calls to the function "strtotime()" - there are two calls,
one at line 185 and one at line 884. "strtotime" takes a plaintext
string, describing a date, and converts it into UNIX time.
OK, so at the end of the string you are going to add a description of
you time zone (mine is BST, British Summer Time) and then an
offset in hours (i.e the time difference between where your server
really is, and where you'd like it to pretend it is).
Confused? Yeah me too, here's an example showing how line 884
looked after I'd hacked it:
$unixdate = strtotime("$publish_month/$publish_day/$publish_year
$publish_hour:$publish_minute:$publish_second BST -5 hours");
Let me explain: My timezone is Europe/London - where we are on
BST - which is what I want displayed on my site. BST is 5 hours
ahead of EST, where my web server lives. You may think that
adding both BST and -5 hours is just plain wrong - and
you'd be right (I said it was a dirty hack). The point is, it works.
The whole reason for this mess is that the timezone PHP hack only
affects PHP - but story.php gets it's dates by asking MySQL what the
time is - so GeekLog ends up wiith two conflicting ideas about the
One more thing, this hack is likely to go wrong when we move in or
out of daylight saving time.
It's all very complex: the GeekLog database dates articles in UNIX
time (which is a sort of GMT). Your server works in it's local time,
and then you hack your PHP environment to look like it's in yet
another time zone. No wonder stuff goes wrong!