Python Forum
Date format conversion "/Date(158889600000)/" - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Date format conversion "/Date(158889600000)/" (/thread-14425.html)



Date format conversion "/Date(158889600000)/" - lbitten - Nov-29-2018

From a JSON file, I'm getting this type of date "/Date(158889600000)/" and I would like to convert this string to a date type.
Does anyone know how I can do that?


RE: Date format conversion "/Date(158889600000)/" - ichabod801 - Nov-29-2018

Not really. I mean, it's not clear what date that is. Even knowing what date it is might not be enough. A common way to store a date or time is as a number of time units (days or seconds, usually) since a particular point in time. But that starting point in time can be different depending on what system generated the number. I would look back to where you got the JSON data from, and see if they describe how the date is defined.


RE: Date format conversion "/Date(158889600000)/" - Larz60+ - Nov-29-2018

That number is greater than that emitted by timt.time
I suspect it is formatted in some way. Need more information.
can you post the code, or point to where it can be looked at?
There's just not enough information here.