Submitted by : 127.0.0.1 at: 2005-11-01T05:09:08+00:00 (12 years ago)
Name :
Category : Severity : Status :
Optional subject :  
Optional comment :

Whenever a page is edited, the last edited time shows up as being "-1 year ago" for a while (several hours). I haven't timed it, but it could be as much as 24 hours before it starts to show normal time. zwiki version 0.37, running under Plone 2.0.4. I've googled for this, and found other people commenting that they have the problem, but haven't seen any solutions. Also looked to see if it was already here or had been fixed, but couldn't see anything. Sorry if this is already fixed....


comments:

need more info --simon, Wed, 08 Feb 2006 17:22:00 -0800 reply
I've never seen this. Is your system's time and timezone correct ? Can you post a link to a page demonstrating this ?

need more info -- Tue, 14 Feb 2006 05:56:33 -0800 reply
I've very recently set up a zope2.8.5/plone2.1.2 installation and installed zwiki 0.50.0 and get the same problem. Timezone is set correctly on the system and the Zope log files are correctly reporting the timezone offset which makes me believe everything should be happy. I'm happy to provide an example, but given the timed nature of the problem, you'll need to get in touch with me when you're ready and I can make a change to a wiki page to trigger the behaviour. lstewart at room52 dot net

need more info --Simon Michael, Tue, 14 Feb 2006 08:52:40 -0800 reply
Thanks, can you chat me on #zwiki ?

zwiki last edited bug --Simon Michael, Sun, 26 Feb 2006 09:48:01 -0800 reply
lstewart, could you give me a manager login in your test wiki ? Or chat me again some time. Also, see if setting your timezone in http://lauren.room52.net:8090/vtm/Members/lstewart/test-wiki/FrontPage/useroptions helps. Thanks.

zwiki last edited bug --Lawrence Ong, Thu, 01 Feb 2007 15:13:19 -0800 reply
Did this go anywhere? I am using Zope 2.9.6 and Plone 2.5.2 with Zwiki 0.58 and is having the same issue.

setting time zone doesn't change it --betabug, Thu, 22 Feb 2007 14:26:51 +0000 reply
I seem to have the same problem on my new test wiki

it's a timezone problem though --betabug, Thu, 22 Feb 2007 14:47:44 +0000 reply
as I have GMT+2 here, Zwiki assumes those changes to have happened 22 hours ago. Maybe it's not picking up the timezone from the OS (no locale on Mac OS X here).

patch is in darcs now - more testing might be needed --betabug, Thu, 22 Feb 2007 16:08:34 +0000 reply
Status: open => closed

The fix was to change the last_edited_time to UTC timezone, as the .ISO() method of Zope's DateTime was losing the timezone information otherwise. Without the timezone information times are assumed to be UTC (aka GMT) anyway.

This might be relevant only on machines whose OS do not have locale support (e.g. *BSD, Mac OS X), but it shoudn't affect machines with locale support. Further testing is very welcome, but I'm anyway closing this bug now.

ZWiki page modified time wrong in different time zones --Bill Page, Thu, 22 Feb 2007 16:47:49 +0000 reply
Possibly related to ZSyncer issue #1252. Maybe this patch will also solve this problem?

ZWiki page modified time wrong in different time zones --betabug, Thu, 22 Feb 2007 20:00:05 +0000 reply
Bill, that might very well be, as the timezone information was "chopped off".

The patch is at this commitdiff page - it's very simple, so even if you can't automatically get it through darcs, you could maybe make those changes yourself and see if it fixes your problem.

My last edit issue --MichaelAng?, Mon, 23 Apr 2007 10:24:54 +0000 reply
Every new update will show me last edit 8hours ago. I figured out that must be my GMT+8 time zone server.

I basically undo the commitdiff page

I have removed all occurrence of ".toZone(UTC)" in CMF.py, Editing.py and Admin.py. This solved my "last_edit_time" issues as my servers are all set in GMT zone. Using slackware 10.2, Zwiki 0.59, zope 2.9

Sorry for editing your comment --betabug, Mon, 23 Apr 2007 10:27:07 +0000 reply
Michael, sorry for editing your comment, but the way you edited the page instead of using the comment form, it appeared as if what you wrote was part of my last comment :-)

My last edit issue --betabug, Mon, 23 Apr 2007 10:41:36 +0000 reply
Now to your issue: From you description I'd say that your server is not set up correctly. I guess your server really uses the time server's timezone and adjusts it in some not normal way to the eight hours difference. If "toZone("UTC")" results in 8 hours difference that means that Zope interprets the time initially to be in the GMT+8 time zone. I'd suggest to insert a print statement with the DateTime? before the statement with the toZone. I bet you will find your "other" timezone in there.

I tried python script in zope on both Windows and Linux, giving the same result

===
from DateTime? import DateTime?
print DateTime?()
print DateTime?().toZone("GMT+8")
print DateTime?().toZone("UTC")
print DateTime?().ISO()
return printed
===
2007/04/23 20:16:45.010 GMT+8
2007/04/23 20:16:45.010 GMT+8
2007/04/23 12:16:45.010 Universal
2007-04-23 20:16:45
===

===
In my linux shell
bash~$ date
Mon Apr 23 20:18:10 SGT 2007

(In Singapore)
===

I believe there is a bug in Utils.py where you don't set toZone("UTC") and the last_edit_time is being set. I did not change this as removing the toZone in other files make more sense.

===

def lastEditIntervalInDays(self):
return int(self.getPhysicalRoot().ZopeTime?() - self.lastEditTime())
def lastEditIntervalInHours(self):
return int((self.getPhysicalRoot().ZopeTime?() - self.lastEditTime()) * 24)

===

should be

def lastEditIntervalInDays(self):
return int(self.getPhysicalRoot().ZopeTime?().toZone("UTC") - self.lastEditTime())
def lastEditIntervalInHours(self):
return int((self.getPhysicalRoot().ZopeTime?().toZone("UTC") - self.lastEditTime()) * 24)