Convert timestamp to datetime

You could also try this:

from datetime import datetime
return datetime.fromtimestamp(value/1000)

where value is the t_stamp value. This works for me when attempting to convert a t_stamp (big int) column from a MySQL table.