On Thu, Aug 14, 2014 at 9:37 PM, Ian Kelly <ian.g.ke...@gmail.com> wrote:
> On Thu, Aug 14, 2014 at 8:24 PM, luofeiyu <elearn2...@gmail.com> wrote:
> > t1 is GMT time   2014  00:36:46
> > t2 is GMT time   2014  14:36:46
>
> You have it backwards. t1 is a later time than t2.
>
> > datetime.datetime.strptime  do not give me the right answer.
>
> >>> dt1 - dt2
> datetime.timedelta(0, 50400)
> >>> _.seconds // 3600
> 14
>
> Looks correct to me.

Also:

>>> dt1.astimezone(datetime.timezone.utc)
datetime.datetime(2014, 8, 9, 14, 36, 46, tzinfo=datetime.timezone.utc)
>>> dt2.astimezone(datetime.timezone.utc)
datetime.datetime(2014, 8, 9, 0, 36, 46, tzinfo=datetime.timezone.utc)
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to