I've got this list of birthdate that is in JSON format, that I want to convert to Python format. What would be the easiest way to convert to python date format?
print(birthdate_json[:5])
gives me the following results :
['/Date(1013230800000)/', '/Date(1016600400000)/', '/Date(1010466000000)/', '/Date(1017205200000)/', '/Date(1020052800000)/']
While I would the desired input to be :
'2002-02-09', '2002-03-20', '2002-01-08', '2002-03-27', '2002-04-29'
listcontaining strings that appear to be some custom date format. (The integer in each string appears to be the number of milliseconds since the Unix epoch.)'/Date(1013230800000)/', parse that. Loop that function over your listdatetime.datetime.utcfromtimestamp(<UNIXtimestamp>).strftime('%Y-%m-%d')