1 # Copyright (c) 2005.-2006. Ivan Voras <ivoras@gmail.com>
2 # Released under the Artistic License
4 from time
import time
, timezone
, strftime
, localtime
, gmtime
7 def unixdate2iso8601(d
):
8 tz
= timezone
/ 3600 # can it be fractional?
10 return strftime('%Y-%m-%dT%H:%M:%S', localtime(d
)) + tz
+ ':00'
12 def unixdate2httpdate(d
):
13 return strftime('%a, %d %b %Y %H:%M:%S GMT', gmtime(d
))
20 if type(d
[k
]) == type(d
):
21 r
+= '<%s>%s</%s>' % (k
, dict2xml(d
[k
]), k
)
23 r
+= '<%s>%s</%s>' % (k
, d
[k
], k
)