Browse files

Used '0:00' instead of 'UTC' which doesn't always exist in Oracle.

Thanks Ian Kelly for the suggestion.
  • Loading branch information...
1 parent 01b6366 commit 4f290bdb60b7d8534abf4ca901bd0844612dcbda @aaugustin aaugustin committed Feb 13, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/db/backends/oracle/
4 django/db/backends/oracle/
@@ -161,13 +161,13 @@ def date_trunc_sql(self, lookup_type, field_name):
# if the time zone name is passed in parameter. Use interpolation instead.
# This regexp matches all time zone names from the zoneinfo database.
- _tzname_re = re.compile(r'^[\w/+-]+$')
+ _tzname_re = re.compile(r'^[\w/:+-]+$')
def _convert_field_to_tz(self, field_name, tzname):
if not self._tzname_re.match(tzname):
raise ValueError("Invalid time zone name: %s" % tzname)
# Convert from UTC to local time, returning TIMESTAMP WITH TIME ZONE.
- result = "(FROM_TZ(%s, 'UTC') AT TIME ZONE '%s')" % (field_name, tzname)
+ result = "(FROM_TZ(%s, '0:00') AT TIME ZONE '%s')" % (field_name, tzname)
# Extracting from a TIMESTAMP WITH TIME ZONE ignore the time zone.
# Convert to a DATETIME, which is called DATE by Oracle. There's no
# built-in function to do that; the easiest is to go through a string.

0 comments on commit 4f290bd

Please sign in to comment.