Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2006-03-22 04:43:49

cnewkirk
Plugin Author
From: Bakersfield, Ca
Registered: 2006-01-04
Posts: 21

Re: Textpattern a day AHEAD

Well, it seems to be happening to me again too. But it is inside the 2 hours around GMT 12:00, so I’ll check it back in a couple of hours to see if it fixes itself again.

So the question is: is this a bug or are we all doing the same thing wrong?

Offline

#12 2006-03-22 05:10:07

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Textpattern a day AHEAD

Bug. What, exactly, is the question.

Offline

#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

#14 2006-03-22 05:48:06

NeilA
Member
From: Blue Mountains, Australia
Registered: 2004-08-15
Posts: 316
Website

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.


Neil – Blue Mountains, Australia

http://westserve.org
http://ministrygrounds.net.au

Offline

#15 2006-03-22 06:06:00

zem
Developer emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579
Website

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
tstate

Offline

#16 2006-03-22 06:51:04

NeilA
Member
From: Blue Mountains, Australia
Registered: 2004-08-15
Posts: 316
Website

Re: Textpattern a day AHEAD

Thanks Alex!

Will make the changes and get back to you.


Neil – Blue Mountains, Australia

http://westserve.org
http://ministrygrounds.net.au

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

#18 2006-03-23 03:30:53

NeilA
Member
From: Blue Mountains, Australia
Registered: 2004-08-15
Posts: 316
Website

Re: Textpattern a day AHEAD

Seems to work well here too Alex…


Neil – Blue Mountains, Australia

http://westserve.org
http://ministrygrounds.net.au

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

Board footer

Powered by FluxBB