Can anybody explain the following?
timex = [2012, 3, 1]
epoch = calendar.timegm(datetime.datetime(*timex).utctimetuple())
date = datetime.date.fromtimestamp(epoch)
print date # [2012, 2, 29]
timex = [2012, 3, 15]
epoch = calendar.timegm(datetime.datetime(*timex).utctimetuple())
date = datetime.date.fromtimestamp(epoch)
print date # [2012, 3, 14]
I'm not sure if it has to do with my misunderstanding of tuples, lists or time in general, but python is always a day behind :P