fix pyflakes/flake8 issue
date is imported as a module, avoid using it as a variable. also PEP8 fix.
This commit is contained in:
parent
a641687824
commit
79769265cf
1 changed files with 9 additions and 8 deletions
|
|
@ -28,16 +28,17 @@ except ImportError:
|
||||||
__all__ = ['local2utc', 'utc2local', 'LinearDateGuesser']
|
__all__ = ['local2utc', 'utc2local', 'LinearDateGuesser']
|
||||||
|
|
||||||
|
|
||||||
def local2utc(date):
|
def local2utc(dateobj):
|
||||||
date = date.replace(tzinfo=tz.tzlocal())
|
dateobj = dateobj.replace(tzinfo=tz.tzlocal())
|
||||||
date = date.astimezone(tz.tzutc())
|
dateobj = dateobj.astimezone(tz.tzutc())
|
||||||
return date
|
return dateobj
|
||||||
|
|
||||||
|
|
||||||
def utc2local(date):
|
def utc2local(dateobj):
|
||||||
date = date.replace(tzinfo=tz.tzutc())
|
dateobj = dateobj.replace(tzinfo=tz.tzutc())
|
||||||
date = date.astimezone(tz.tzlocal())
|
dateobj = dateobj.astimezone(tz.tzlocal())
|
||||||
return date
|
return dateobj
|
||||||
|
|
||||||
|
|
||||||
class LinearDateGuesser(object):
|
class LinearDateGuesser(object):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue