Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#13 2006-03-22 05:42:05
- cnewkirk
- Plugin Author
- From: Bakersfield, Ca
- Registered: 2006-01-04
- Posts: 21
Re: Textpattern a day AHEAD
um…well, I guess you answered it. Thanks.
It seems to be a bug, so I guess I’ll wait for a fix since I’m useless with php.
But please tell me if there’s anything I can do to help get this working. (provide information, change settings, test new code, etc…)
Offline
Re: Textpattern a day AHEAD
To summarise Mary:
With the server running Txp in the same time zone as me (GMT +10), once a day (I think one hour before to one hour after GMT Midnight), Txp loses track of what day it is.
To quote from my first post:
The Date/time and Time Zone on the Linux box are correct.
TxP diagnostic reflects the correct server time.
The time zone on the ‘preferences’ tab is correct (GMT +10, DST)
But the time shown on the ‘preferences’ tab is one day ahead of real time, and all existing posts show their time posted as being one day out too.
I don’t see this on my live sites which are hosted on the west coast of the U.S. in a different time zone altogether.
So, is this a TxP problem, a PHP problem?
It’s not a desperate issue, but I’m curious.
Offline
#15 2006-03-22 06:06:00
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: Textpattern a day AHEAD
It’s a txp problem. Try editing txplib_misc.php and change tz_offset() to this:
function tz_offset()
{
global $gmtoffset, $is_dst;
extract(getdate());
$serveroffset = gmmktime(0,0,0,$mon,$mday,$year) - mktime(0,0,0,$mon,$mday,$year);
$offset = $gmtoffset - $serveroffset;
return $offset + ($is_dst ? 3600 : 0);
}
Let me know if it works.
Alex
Offline
Re: Textpattern a day AHEAD
Thanks Alex!
Will make the changes and get back to you.
Offline
#17 2006-03-23 01:16:19
- cnewkirk
- Plugin Author
- From: Bakersfield, Ca
- Registered: 2006-01-04
- Posts: 21
Re: Textpattern a day AHEAD
I tried that here and it looks like it worked. The date was showing up as yesterday, but when I made the change above and saved the file, and hit refresh, the date corrected itself.
Thank You Alex!
Now I’ll just keep an eye on it for a day or so.
Offline
Re: Textpattern a day AHEAD
Seems to work well here too Alex…
Offline
#19 2006-03-30 04:47:16
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Textpattern a day AHEAD
The fix for this was added to the dev svn repo, so it should (assuming the fix doesn’t cause other bugs) appear in the next stable maintenance release. :)
Offline