[Solved] How to convert 12 hour string into 24 hour datetime? [closed]

The main problem with your format is that Python does not support anything more granular than microseconds, as explained here. In fact, assuming you have 000 as the last three decimals of seconds, you can use the format below. from datetime import datetime datetime_object = datetime.strptime(’24/NOV/18 05:15:00.000000000 AM’, ‘%d/%b/%y %I:%M:%S.%f000 %p’) If you cannot make … Read more

[Solved] strptime returning NA values [closed]

The format argument you give should reflect the format that the data is currently in, not the format that you want to convert it to, so you would have to set format = “%Y-%m-%d”. Read the documentation on strptime again and it should make sense. 1 solved strptime returning NA values [closed]