convert comment time to UTC

This commit is contained in:
Romain Bignon 2010-04-04 15:10:59 +02:00
commit 97d6ad447b
2 changed files with 13 additions and 3 deletions

View file

@ -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