Correctifs sur les adhésions glissantes.

This commit is contained in:
Pierre-Elliott Bécue 2014-08-25 19:17:10 +02:00
parent 7f1ffbeed5
commit 50f91c63e0
4 changed files with 32 additions and 27 deletions

View file

@ -309,9 +309,9 @@ def ip4_addresses():
def extractTz(thetz):
abstz = 100*abs(thetz)
if thetz == 0:
return "Z"
return u"Z"
else:
return "%s%04d" % ("+"*(thetz < 0) + "-"*(thetz > 0), abstz)
return u"%s%04d" % ("+"*(thetz < 0) + "-"*(thetz > 0), abstz)
def toGeneralizedTimeFormat(stamp):
"""Converts a timestamp (local) in a generalized time format
@ -322,7 +322,7 @@ def toGeneralizedTimeFormat(stamp):
"""
return "%s%s" % (time.strftime("%Y%m%d%H%M%S", time.localtime(stamp)), extractTz(time.altzone/3600))
return u"%s%s" % (time.strftime("%Y%m%d%H%M%S", time.localtime(stamp)), extractTz(time.altzone/3600))
def fromGeneralizedTimeFormat(gtf):
"""Converts a GTF stamp to unix timestamp