convert comment time to UTC
This commit is contained in:
parent
9d6da1e7bb
commit
97d6ad447b
2 changed files with 13 additions and 3 deletions
|
|
@ -18,6 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
"""
|
||||
|
||||
from dateutil import tz
|
||||
|
||||
def toUnicode(text):
|
||||
r"""
|
||||
>>> toUnicode('ascii')
|
||||
|
|
@ -37,3 +39,8 @@ def toUnicode(text):
|
|||
pass
|
||||
return unicode(text, "ISO-8859-1")
|
||||
|
||||
def local2utc(d):
|
||||
d = d.replace(tzinfo=tz.tzlocal())
|
||||
d = d.astimezone(tz.tzutc())
|
||||
return d
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue