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.

I'm trying this way:

my_date =
datetime.datetime.fromtimestamp(api['backpack_update'][GAME_ID]).strftime("%D
%H:%M")

The key ' api['backpack_update'][GAME_ID] ' returns exactly what's
expected, the timestamp in string format. But now I need to convert this to
a "full date and time" so that I can print in the terminal/cmd like '
print(my_date) '.

I already read the https://docs.python.org/2/library/datetime.html and I
think that the func 'strptime' may resolve my problem, already tried with
this one, but didn't work.
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to