Converting a text timestamp to an actual datetime object

591
0
07-26-2021 09:45 PM
clintonH2A
New Contributor

I had a point file with X, Y pairs tied to a string timestamp - unreadable by ArcPro & the convert time tool.  I had to write a tiny script and thought I'd share it if you find yourself in a similar spot:

clintonH2A_0-1627361091347.png

 

from datetime import datetime 

def getDate(timestamp):
    datetimeObject = datetime.fromtimestamp(timestamp)
    return datetimeObject

 

Tags (3)
0 Replies