@@ -89,7 +89,7 @@ def combine_expression(self, connector, sub_expressions):
8989 def convert_datetimefield_value (self , value , expression , connection ):
9090 if value is not None :
9191 if settings .USE_TZ :
92- value = timezone .make_aware (value , timezone . utc )
92+ value = timezone .make_aware (value , self . connection . timezone )
9393 return value
9494
9595 def convert_floatfield_value (self , value , expression , connection ):
@@ -157,7 +157,7 @@ def datetime_trunc_sql(self, lookup_type, field_name, tzname):
157157
158158 def for_update_sql (self , nowait = False , skip_locked = False , of = ()):
159159 if skip_locked :
160- return 'WITH (NOLOCK )'
160+ return 'WITH (ROWLOCK, UPDLOCK, READPAST )'
161161 elif nowait :
162162 return 'WITH (NOWAIT, ROWLOCK, UPDLOCK)'
163163 else :
@@ -393,7 +393,7 @@ def adapt_datetimefield_value(self, value):
393393 return None
394394 if settings .USE_TZ and timezone .is_aware (value ):
395395 # pyodbc donesn't support datetimeoffset
396- value = value .astimezone (timezone . utc ).replace (tzinfo = None )
396+ value = value .astimezone (self . connection . timezone ).replace (tzinfo = None )
397397 return value
398398
399399 def time_trunc_sql (self , lookup_type , field_name ):
0 commit comments