-# return timestamp with timezone information
-# so we could parse it in javascript
-def tzdate(t):
- # as strftime %z is unofficial, and does not work, need to make it numeric ourselves
-# date = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(t))
- date = time.strftime("%a %b %d %Y %H:%M:%S", time.localtime(t))
- # NOTE: the altzone is showing CURRENT timezone, not what the "t" reflects
- # NOTE: when DST is off timezone gets it right, altzone not
- if time.daylight:
- tzoffset = time.altzone
- else:
- tzoffset = time.timezone
- tz = '%+05d' % (-tzoffset / 3600 * 100)
- return date + ' ' + tz
-