{"id":9952,"date":"2021-07-08T11:12:04","date_gmt":"2021-07-08T05:42:04","guid":{"rendered":"https:\/\/pynative.com\/?p=9952"},"modified":"2021-12-05T10:22:57","modified_gmt":"2021-12-05T04:52:57","slug":"python-string-to-datetime-strptime","status":"publish","type":"post","link":"https:\/\/pynative.com\/python-string-to-datetime-strptime\/","title":{"rendered":"Python String to DateTime using strptime()"},"content":{"rendered":"\n

In this tutorial, we’ll see how to parse a string to a datetime using the strptime()<\/code> with the various standard date formatting codes available in Python. In addition, we will see similar methods available in the other modules for converting a string to a date<\/code> or time<\/code> object.<\/p>\n\n\n\n

Table of contents<\/h2>