[Zope-CMF] CMFDefault skins: no timezone?

Paul Winkler pw_lists at slinkp.com
Mon Jan 31 00:45:57 EST 2005


Hiya,

I wanted to ask for discussion of this before submitting a collector
item.  The Dublin Core definitions at
http://dublincore.org/documents/dcmi-terms/ state that
"modified" should be in ISO format YYYY-MM-DD, and don't
say anything about timezone.  

But there's a problem with the way this is implemented in CMFDefault.
What happens when you use the import/export system (or ZSyncer) to
copy ZODB objects from one server to another in a different timezone?
It turns out that the result looks "wrong".

Example:

Server A is running in US/Eastern.
On server A, object FooDoc was modified at 13:00:00 US/Eastern.

Server B is running in GMT.
On server B, object BarDoc was modified at 13:00:00 GMT.
Note that BarDoc is five hours older than FooDoc.

Now we export FooDoc from A and import it into B,
in the same folder as BarDoc.
folder_contents shows them both modified at 13:00:00 which,
in the absence of timezone information, is certainly misleading.

My opinion is that we should do the Right Thing, by which I mean
to show the user times that can be judged against each other
correctly regardless of where the object originates.

I can think of a couple ways to do this:

1) In DublinCore, change ModificationDate() to convert to
the local timezone before calling ISO().  Example:

    def ModificationDate( self ):
        """ Dublin Core Date element - date resource last modified.
        """
        zone = DateTime().timezone()
        modified = self.modified().toZone(zone)
        return modified.ISO()

I've tested this, it works.
For consistency, I suppose we should do the same
with Date, CreationDate, ExpirationDate, and EffectiveDate. 

- OR -

2) change ModificationDate() et al. to include timezone
information.  Example:

    def ModificationDate( self ):
        """ Dublin Core Date element - date resource last modified.
        """
        modified = self.modified()
        return '%s %s' % (modified.ISO(), modified.timezone()) 


Opinions?

If the consensus is that this is Not A Problem, I'm ok with hacking
ZSyncer to attempt to fix timezone on CMF content after import.
But that feels ... well, hacky.

-- 

Paul Winkler
http://www.slinkp.com


More information about the Zope-CMF mailing list