While it seems the question was answered per the OP's request, none of the answers give a good way to get a datetime.date object instead of a datetime.datetime. So for those searching and finding this thread:

datetime.date has no .strptime method; use the one on datetime.datetime instead and then call .date() on it to receive the datetime.date object.

Like so:

>>> from datetime import datetime
>>> datetime.strptime('2014-12-04', '%Y-%m-%d').date()
datetime.date(2014, 12, 4)
Answer from Darian Moody on Stack Overflow
๐ŸŒ
Pandas
pandas.pydata.org โ€บ docs โ€บ reference โ€บ api โ€บ pandas.to_datetime.html
pandas.to_datetime โ€” pandas 3.0.1 documentation
Convert dtypes. ... scalars can be int, float, str, datetime object (from stdlib datetime module or numpy). They are converted to Timestamp when possible, otherwise they are converted to datetime.datetime.
๐ŸŒ
DataCamp
datacamp.com โ€บ tutorial โ€บ converting-strings-datetime-objects
Convert String to DateTime in Python: Complete Guide with Examples | DataCamp
June 8, 2018 - In all of these cases we showed, we used datetime objects, but the real-world data often remains as a string in practice. And converting to a datetime object unlocks all of the above functionalities that are powerful in data science analysis and applications. In Python, we can use the datetime.st...
๐ŸŒ
DigitalOcean
digitalocean.com โ€บ community โ€บ tutorials โ€บ python-string-to-datetime-strptime
How To Convert a String to a datetime Object in Python | DigitalOcean
December 13, 2024 - In this article, youโ€™ll use strptime() to convert strings into datetime and struct_time() objects. Deploy your Python applications from GitHub using DigitalOcean App Platform.
๐ŸŒ
Python Morsels
pythonmorsels.com โ€บ converting-a-string-to-a-datetime
Converting a string to a datetime - Python Morsels
September 30, 2024 - The datetime.strptime class method can parse a date/time string into a datetime object.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-convert-string-to-datetime-and-vice-versa
Convert string to DateTime and vice-versa in Python - GeeksforGeeks
July 11, 2025 - The Dateutil is a third-party module. The Dateutil module supports the parsing of dates in any string format. Internal facts about current world time zones are provided by this module. Parse() can convert a Python string to date-time format.
๐ŸŒ
Medium
medium.com โ€บ @generativeai.saif โ€บ how-to-convert-a-string-to-a-date-in-python-complete-guide-for-2025-bd5ece07c57c
How to Convert a String to a Date in Python: Complete Guide for 2025 | by Saif Ali | Medium
April 6, 2025 - Notice how the space between the date and time must be included in the format string. Every character in the input string needs a corresponding element in the format pattern. After converting a string to a datetime object, you might need just the date or time component. Python makes this easy with the .date() and .time() methods:
๐ŸŒ
Educative
educative.io โ€บ answers โ€บ how-to-convert-a-string-to-a-date-in-python
How to convert a string to a date in Python
The syntax for the method used to convert string to datetime object is strptime(x,y) where: ... y is the format directives in which the string date is stored.
Find elsewhere
๐ŸŒ
Accuweb
accuweb.cloud โ€บ home โ€บ how to convert a string to a datetime or time object in python
How To Convert a String to a datetime or time Object in Python - AccuWeb Cloud
December 1, 2023 - You can convert a string to a datetime or time object in Python using the datetime module, which provides various functions and classes for working with date and time values.
๐ŸŒ
Programiz
programiz.com โ€บ python-programming โ€บ examples โ€บ string-to-datetime
Python Program to Convert String to Datetime
To understand this example, you ... '%b %d %Y %I:%M%p') print(type(datetime_object)) print(datetime_object) ... Using strptime(), date and time in string format can be converted to datetime type....
๐ŸŒ
InfluxData
influxdata.com โ€บ home โ€บ how to convert string to datetime in python
How to Convert String to Datetime in Python | InfluxData
October 30, 2023 - Converting between text and types related to dates and times is a commonplace task in programming languages, and Python is certainly no exception. That's why in this post we'll treat you to a string-to-datetime Python conversion tutorial. #influxdb
๐ŸŒ
IONOS
ionos.com โ€บ digital guide โ€บ websites โ€บ web development โ€บ convert strings to datetime in python
How to convert a string to datetime in Python - IONOS
December 17, 2024 - The strptime() (string parse time) method from the datetime library is used to convert a string into a Python datetime object.
๐ŸŒ
Vultr
docs.vultr.com โ€บ python โ€บ examples โ€บ convert-string-to-datetime
Python Program to Convert String to Datetime | Vultr Docs
November 22, 2024 - Converting strings into datetime objects in Python is an essential task for many applications involving date manipulations. By using Python's datetime.strptime() method, you can handle various date string formats efficiently. Remember to consider timezone handling and error management to cover common pitfalls in date conversion processes.
๐ŸŒ
Tutorial Teacher
tutorialsteacher.com โ€บ articles โ€บ convert-string-to-datetime-in-python
Convert String to Datetime in Python
The module defines the following unique codes for formatting datetime string according to their predefined meaning. Let's use the strptime() method to convert a given string to a datetime object, as shown below:
๐ŸŒ
Programiz
programiz.com โ€บ python-programming โ€บ datetime โ€บ strftime
Python strftime() - datetime to string
Become a certified Python programmer. Try Programiz PRO! ... The strftime() method returns a string representing date and time using date, time or datetime object. The program below converts a datetime object containing current date and time to different string formats.
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ how-to-convert-a-string-to-a-datetime-object-in-python
How to Convert a String to a DateTime Object in Python
December 17, 2024 - The solution to this problem is to parse (or convert) the string object into a datetime object so Python can recognized it as a date.
๐ŸŒ
iO Flood
ioflood.com โ€บ blog โ€บ convert-string-to-date
Convert String to Date in Python: Object Handling Tutorial
March 11, 2024 - In this example, we import the datetime module and use the strptime() function to convert a string to a date. The string โ€˜2022-01-01โ€™ is parsed according to the format โ€˜%Y-%m-%dโ€™, resulting in the output โ€˜2022-01-01 00:00:00โ€™. But ...
๐ŸŒ
Stack Abuse
stackabuse.com โ€บ converting-strings-to-datetime-in-python
Converting Strings to datetime in Python
June 21, 2023 - In this tutorial, we'll be converting Strings to datetime in Python, dealing with Timezones. We'll also use dateutil, Maya and Arrow to convert Strings to datetime with automatic format recognition.