1>>> from datetime import datetime
2>>> ts = int("1284101485")
3
4# if you encounter a "year is out of range" error the timestamp
5# may be in milliseconds, try `ts /= 1000` in that case
6>>> print(datetime.utcfromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S'))
7#'%Y' will be replaced by the year '%m' by the month '%d; by the day and so on
8#You move these how you want in the string, other characters will be ignored!
9... '2010-09-10 06:51:25'