[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/DateIndex - DateIndex.py:1.7.6.1
Andreas Jung
andreas@andreas-jung.com
Sun, 8 Jun 2003 04:53:21 -0400
Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/DateIndex
In directory cvs.zope.org:/tmp/cvs-serv2480/lib/python/Products/PluginIndexes/DateIndex
Modified Files:
Tag: Zope-2_6-branch
DateIndex.py
Log Message:
- Collector #928: DateIndex ignored timezones when indexing and
querying
=== Zope/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py 1.7 => 1.7.6.1 ===
--- Zope/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py:1.7 Wed Aug 14 18:19:27 2002
+++ Zope/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py Sun Jun 8 04:52:50 2003
@@ -168,12 +168,14 @@
def _convert( self, value, default=None ):
"""Convert Date/Time value to our internal representation"""
+ # XXX: Code patched 20/May/2003 by Kiran Jonnalagadda to
+ # convert dates to UTC first.
if isinstance( value, DateTime ):
- t_tup = value.parts()
+ t_tup = value.toZone('UTC').parts()
elif type( value ) in (FloatType, IntType):
t_tup = time.gmtime( value )
elif type( value ) is StringType:
- t_obj = DateTime( value )
+ t_obj = DateTime( value ).toZone('UTC')
t_tup = t_obj.parts()
else:
return default