Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

Thanks Ian Kelly for the suggestion.
  • Loading branch information...
commit 4f290bdb60b7d8534abf4ca901bd0844612dcbda 1 parent 01b6366
@aaugustin aaugustin authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/db/backends/oracle/base.py
View
4 django/db/backends/oracle/base.py
@@ -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.
# https://groups.google.com/forum/#!msg/django-developers/zwQju7hbG78/9l934yelwfsJ
# 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.
Please sign in to comment.
Something went wrong with that request. Please try again.