On Fri, Sep 19, 2014 at 4:00 PM, Juan Christian
<[email protected]> wrote:
> Let's say I have ' 1411167038 ' string that I got from an API and I need to
> convert it to something like ' Fri, 19 Sep 2014 22:50:38 GMT ' or maybe even
> the localtime of the PC.

What does that number mean though?  Let me guess: is it the number of
seconds since the Epoch?

>>> t = 1411167038
>>> import datetime
>>> datetime.datetime.fromtimestamp(t)
datetime.datetime(2014, 9, 19, 15, 50, 38)

... I think that's what that number means.  It may be the number of
seconds since the Epoch.

References:

    
https://docs.python.org/2/library/datetime.html#datetime.datetime.fromtimestamp
    https://docs.python.org/2/library/time.html#time.time
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to