[Erp5-report] r17869 - /erp5/trunk/products/ZSQLCatalog/SQLCatalog.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Nov 28 15:20:21 CET 2007


Author: ivan
Date: Wed Nov 28 15:20:21 2007
New Revision: 17869

URL: http://svn.erp5.org?rev=17869&view=rev
Log:
Convert explicitly DateTime values to UTC.

Modified:
    erp5/trunk/products/ZSQLCatalog/SQLCatalog.py

Modified: erp5/trunk/products/ZSQLCatalog/SQLCatalog.py
URL: http://svn.erp5.org/erp5/trunk/products/ZSQLCatalog/SQLCatalog.py?rev=17869&r1=17868&r2=17869&view=diff
==============================================================================
--- erp5/trunk/products/ZSQLCatalog/SQLCatalog.py (original)
+++ erp5/trunk/products/ZSQLCatalog/SQLCatalog.py Wed Nov 28 15:20:21 2007
@@ -231,10 +231,8 @@
         value = value.replace(' ','')
         value = "'%s'" % value
     else:
-      if hasattr(value, 'ISO'):
-        value = "'%s'" % value.ISO()
-      elif hasattr(value, 'strftime'):
-        value = "'%s'" % value.strftime('%Y-%m-%d %H:%M:%S')
+      if getattr(value, 'ISO', None) is not None:
+        value = "'%s'" % value.toZone('UTC').ISO()
       else:
         value = "'%s'" % sql_quote(str(value))
     return value




More information about the Erp5-report mailing list