I have survey data that was exported from a SQLite database into a CSV so it could be appended to the survey dataset. The process works okay, but I am unsure how to convert the time and date fields. They are not datetime types, one is specifically a date field, and the other is time. An example of the data is below:
"Collect_Date": 1657987200000
"Collect_Time": 1657987800000
Has anyone converted from this format before? I thought it might be UTC or epoch, but the times seem off when I run them through an online converter.
Thanks in advance!
Solved! Go to Solution.
Edit -- here is the python script I used to solve this issue, where x is the long integer being output:
from datetime import datetime
d = int(x/1000)
date = datetime.utcfromtimestamp(d).strftime('%m/%d/%Y %H:%M:%S')
Edit -- here is the python script I used to solve this issue, where x is the long integer being output:
from datetime import datetime
d = int(x/1000)
date = datetime.utcfromtimestamp(d).strftime('%m/%d/%Y %H:%M:%S')