Navigation Menu

Skip to content

Commit

Permalink
Fixed #9275: Extended the Oracle date format to allow DATE columns to…
Browse files Browse the repository at this point in the history
… be used with DateTimeFields, especially when using legacy databases. Thanks to hollerith for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9779 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
nightflyerkilo committed Jan 19, 2009
1 parent 795c229 commit 7281088
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django/db/backends/oracle/base.py
Expand Up @@ -269,7 +269,7 @@ def _cursor(self, settings):
cursor = FormatStylePlaceholderCursor(self.connection)
# Set oracle date to ansi date format. This only needs to execute
# once when we create a new connection.
cursor.execute("ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD' "
cursor.execute("ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS' "
"NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF'")
try:
self.oracle_version = int(self.connection.version.split('.')[0])
Expand Down

0 comments on commit 7281088

Please sign in to comment.