Commit 87ba2dfe authored by Ivan Tyagov's avatar Ivan Tyagov

Convert explicitly DateTime values to UTC.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17869 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7e14ffd0
...@@ -231,10 +231,8 @@ class QueryMixin: ...@@ -231,10 +231,8 @@ class QueryMixin:
value = value.replace(' ','') value = value.replace(' ','')
value = "'%s'" % value value = "'%s'" % value
else: else:
if hasattr(value, 'ISO'): if getattr(value, 'ISO', None) is not None:
value = "'%s'" % value.ISO() value = "'%s'" % value.toZone('UTC').ISO()
elif hasattr(value, 'strftime'):
value = "'%s'" % value.strftime('%Y-%m-%d %H:%M:%S')
else: else:
value = "'%s'" % sql_quote(str(value)) value = "'%s'" % sql_quote(str(value))
return value return value
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment