[Answered ]-Convert a timestamp to a DateTime field?

1👍

Yes As mentioned by @Sevy in his comment you can use the following

from datetime import datetime

timestamp = 1640206232 
dt_object = datetime.fromtimestamp(timestamp, tz='UTC') # Or whatever timezone you want

print("dt_object =", dt_object)
print("type(dt_object) =", type(dt_object))

More info and how to convert the other way can be found here:
https://www.programiz.com/python-programming/datetime/timestamp-datetime

Leave a comment