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']
|
||||
|
||||
|
||||
def local2utc(date):
|
||||
date = date.replace(tzinfo=tz.tzlocal())
|
||||
date = date.astimezone(tz.tzutc())
|
||||
return date
|
||||
def local2utc(dateobj):
|
||||
dateobj = dateobj.replace(tzinfo=tz.tzlocal())
|
||||
dateobj = dateobj.astimezone(tz.tzutc())
|
||||
return dateobj
|
||||
|
||||
|
||||
def utc2local(date):
|
||||
date = date.replace(tzinfo=tz.tzutc())
|
||||
date = date.astimezone(tz.tzlocal())
|
||||
return date
|
||||
def utc2local(dateobj):
|
||||
dateobj = dateobj.replace(tzinfo=tz.tzutc())
|
||||
dateobj = dateobj.astimezone(tz.tzlocal())
|
||||
return dateobj
|
||||
|
||||
|
||||
class LinearDateGuesser(object):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue