<div dir="ltr">On Thu, Aug 14, 2014 at 9:37 PM, Ian Kelly <<a href="mailto:ian.g.kelly@gmail.com">ian.g.kelly@gmail.com</a>> wrote:<br>> On Thu, Aug 14, 2014 at 8:24 PM, luofeiyu <<a href="mailto:elearn2014@gmail.com">elearn2014@gmail.com</a>> wrote:<br>
> > t1 is GMT time 2014 00:36:46<br>> > t2 is GMT time 2014 14:36:46<br>><br>> You have it backwards. t1 is a later time than t2.<br>><br>> > datetime.datetime.strptime do not give me the right answer.<br>
><br>> >>> dt1 - dt2<br>> datetime.timedelta(0, 50400)<br>> >>> _.seconds // 3600<br>> 14<br>><br>> Looks correct to me.<div><br></div><div>Also:</div><div><div><br></div><div>>>> dt1.astimezone(datetime.timezone.utc)</div>
<div>datetime.datetime(2014, 8, 9, 14, 36, 46, tzinfo=datetime.timezone.utc)</div><div>>>> dt2.astimezone(datetime.timezone.utc)</div><div>datetime.datetime(2014, 8, 9, 0, 36, 46, tzinfo=datetime.timezone.utc)</div>
</div></div>