We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
The following ought to create a UTC timestamp based on local time plus offset. This should not be so hard!
def timestamp(): """ Construct a utc offset timestamp containing the local time. """ t = time.localtime() dt = (time.timezone,time.altzone)[t.tm_isdst] local = time.strftime('%Y-%m-%dT%H:%M:%S',t) sign = "+" if dt > 0 else "-" offset = "%02d:%02d"%(abs(dt)//3600,(abs(dt)%3600)//60) return local+sign+offset