Skip to content

Commit c584833

Browse files
committed
datetime convertion should use client timezone
1 parent 5a0fbc8 commit c584833

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

uliweb_apijson/apijson/views.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#coding=utf-8
2-
from uliweb import expose, functions, models, UliwebError
2+
from uliweb import expose, functions, models, UliwebError, request
33
from uliweb.orm import ModelNotFound
44
from uliweb.utils._compat import string_types
55
from uliweb.utils.date import to_datetime
@@ -300,7 +300,7 @@ def _conver():
300300
nonlocal v
301301
if v and col.type.python_type==datetime:
302302
_v = v
303-
v = to_datetime(v)
303+
v = to_datetime(v,tzinfo=request.tzinfo)
304304
if v==None:
305305
raise UliwebError("'%s' cannot convert to datetime"%(_v))
306306
if c1=='>':

0 commit comments

Comments
 (0)