new function utc2local
This commit is contained in:
parent
46d00b4c79
commit
d0ee7cbd49
1 changed files with 5 additions and 0 deletions
|
|
@ -48,6 +48,11 @@ def local2utc(d):
|
|||
d = d.astimezone(tz.tzutc())
|
||||
return d
|
||||
|
||||
def utc2local(d):
|
||||
d = d.replace(tzinfo=tz.tzutc())
|
||||
d = d.astimezone(tz.tzlocal())
|
||||
return d
|
||||
|
||||
try:
|
||||
import html2text as h2t
|
||||
h2t.UNICODE_SNOB = 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue