Ticket #8354: mysql-datetime.diff
File mysql-datetime.diff, 651 bytes (added by , 16 years ago) |
---|
-
django/db/backends/mysql/base.py
=== modified file 'django/db/backends/mysql/base.py'
4 4 Requires MySQLdb: http://sourceforge.net/projects/mysql-python 5 5 """ 6 6 7 import datetime 7 8 import re 8 9 9 10 from django.db.backends import * … … 132 133 # MySQL doesn't support microseconds 133 134 if value is None: 134 135 return None 136 if isinstance(value, datetime.datetime): 137 return value.strftime('%Y-%m-%d %H:%M:%S') 135 138 return unicode(value.replace(microsecond=0)) 136 139 137 140 def value_to_db_time(self, value):