> Take a look at the utcoffset method of datetime objects.
This returns 0.
However, meanwhile I figured out a way to do this:
Every datetime object by default does not handle timezones at all, and
as such "isoformat" does not return an offset in the ISO8601 string.
The only way around this appear
Samuel> mydatetime = datetime.datetime(year, month, day, hour, minute)
Samuel> strtime= mydatetime.isoformat()
Take a look at the utcoffset method of datetime objects.
Samuel> The second problem has to do with the ISO8601 parser, which
Samuel> raises the following error:
Hello,
I am trying to convert a local time into UTC ISO8601, then parse it
back into local time. I tried the following:
--
#!/usr/bin/python
import time
import datetime
import xml.utils.iso8601
year = 2005
month = 7
day= 22
hour = 10 # This is localtime
minute = 30