I have the following script defining a tzinfo
object:
import time
from datetime import datetime, timedelta, tzinfo
class ManilaTime(tzinfo):
def utcoffset(self, dt):
return timedelta(hours=8)
def tzname(self, dt):
return "Manila"
manila = ManilaTime()
Now, I'm going to say
t = datetime(tzinfo=manila, *time.gmtime()[:-3])
print t
which gives me
2011-07-24 12:52:06+08:00
Question: What does 12:52:06+08:00
mean? I want to learn how to read time information which includes a UTC offset, according to standards. Please disregard that I used time.gmtime()
. Let's say I only got the time string itself. How do I read it?
A. I need to perform the addition to get Manila Time. Upon reading this, I should make a calculation and I'll say
It's
12:52:06
in Greenwich, which I should offset by+08:00
. Meaning, it is20:52:06
in Manila.
B. I'll take it at face value and say
It's
12:52:06
in Manila, and it's offset from UTC by+08:00
. Meaning, it is04:52:06
in Greenwich.
Which is correct? A or B?