Use the date() method:

datetime.datetime.now().date()
Answer from ars on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-convert-datetime-to-date-in-python
How to convert datetime to date in Python - GeeksforGeeks
July 23, 2025 - In this example, we take the present date and time and extracted its date from the object. ... # import important module from datetime import datetime # call datetime.strptime to # convert it into datetime datatype datetime_obj = datetime.now() # It will print the datetime object print(datetime_obj) # extract the time from datetime_obj date = datetime_obj.date() print(date)
Discussions

Convert date to datetime in Python - Stack Overflow
Is there a built-in method for converting a date to a datetime in Python, for example getting the datetime for the midnight of the given date? The opposite conversion is easy: datetime has a .date() More on stackoverflow.com
🌐 stackoverflow.com
How to turn a datetime into just a date?
If those are actually datetimes, then you can call date on them: df['Date'] = df['Date'].dt.date More on reddit.com
🌐 r/learnpython
8
4
November 30, 2023
python - Convert existing datetime array to date - Stack Overflow
I have a column of dates. I want to calculate the number of days between each datetime in the array and a specified date. import datetime print(mydates[0]) 2013-04-30T20:00:00.000000000-0400 More on stackoverflow.com
🌐 stackoverflow.com
Convert Date like "Mar 24, 2021" to Datetime
In this case, it's import datetime datetime.datetime.strptime("Mar 24, 2021", "%b %d, %Y") But in the future the .strptime() method converts a string to a datetime object and the .strftime() method converts a datetime object to a string. To see the format codes, check out the python documentation . More on reddit.com
🌐 r/learnpython
16
6
March 27, 2021
🌐
GeeksforGeeks
geeksforgeeks.org › python › convert-date-to-datetime-in-python
Convert Date To Datetime In Python - GeeksforGeeks
July 23, 2025 - In this example, below Python code imports necessary datetime modules and creates a date object (MyDate) representing April 3, 2004. It then forms a datetime object (DateTime) using the year, month, and day components from MyDate, with the default time set to midnight.
🌐
W3Schools
w3schools.com › python › python_datetime.asp
Python Dates
A date in Python is not a data type of its own, but we can import a module named datetime to work with dates as date objects.
🌐
PYnative
pynative.com › home › python › python datetime › python datetime format using strftime()
Python DateTime Format using Strftime() – PYnative
May 6, 2022 - Also, refer to convert a string to DateTime in Python · Convert individual attributes of a datetime object to a string format: – · For example, you can convert only date, time, year, or day from a datetime object to a string using the appropriate format code.
Find elsewhere
🌐
Reddit
reddit.com › r/learnpython › how to turn a datetime into just a date?
r/learnpython on Reddit: How to turn a datetime into just a date?
November 30, 2023 -

Hello everyone, this is what my date column looks like:

Date
2023-11-30 23:20:12
2023-11-29 20:19:46
2023-11-28 21:33:25
2023-11-27 15:31:32

What I am trying to do it turn the dates in the column into this "2023-11-30" format only. So I am just trying to have the date and the time not be in the column. Can some please show me how to get rid of the time part of in the date column so that I am left with just this format for dates in the date column:

2023-11-30

🌐
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. Two arguments are required: the string to be parsed and the date/time format of the string.
🌐
Favtutor
favtutor.com › articles › pandas-datetime-to-date
Convert Datetime to Date Column in Pandas (with code)
January 4, 2024 - Here are some easy methods to convert datetime to date column in Pandas using date method and normalize function.
🌐
Python documentation
docs.python.org › 3 › library › datetime.html
datetime — Basic date and time types
A timedelta object represents a duration, the difference between two datetime or date instances. class datetime.timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0)¶ · All arguments are optional and default to 0. Arguments may be integers or floats, and may be positive or negative. Only days, seconds and microseconds are stored internally. Arguments are converted to those units:
🌐
Mimo
mimo.org › glossary › python › datetime
Python datetime Module: Working with Dates, Times, and Formatting
Start your coding journey with Python. Learn basics, data types, control flow, and more ... 1. Convert String to datetime (Parsing): Use datetime.strptime(date_string, format_code) to parse a string into a datetime object.
🌐
TutorialsPoint
tutorialspoint.com › how-to-convert-python-date-string-mm-dd-yyyy-to-datetime
How to convert Python date string mm/dd/yyyy to datetime?
September 28, 2023 - In Python, you can convert a string to date object using the strptime() function. Provide the date string and the format in which the date is specified. import datetime date_str = '29/12/2017' # The date - 29 Dec 2017 format_str = '%d/%m/%Y' ...
🌐
Real Python
realpython.com › python-datetime
Using Python datetime to Work With Dates and Times – Real Python
September 25, 2023 - Have you ever wondered about working with dates and times in Python? In this tutorial, you'll learn all about the built-in Python datetime library. You'll also learn about how to manage time zones and daylight saving time, and how to do accurate arithmetic on dates and times.
🌐
Pandas
pandas.pydata.org › docs › reference › api › pandas.to_datetime.html
pandas.to_datetime — pandas 3.0.1 documentation
The object to convert to a datetime. If a DataFrame is provided, the method expects minimally the following columns: "year", "month", "day". The column “year” must be specified in 4-digit format. errors{‘raise’, ‘coerce’}, default ‘raise’ · If 'raise', then invalid parsing will raise an exception. If 'coerce', then invalid parsing will be set as NaT. ... Specify a date parse order if arg is str or is list-like.
🌐
Codemia
codemia.io › knowledge-hub › path › convert_date_to_datetime_in_python
Convert date to datetime in Python
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises
🌐
Sololearn
sololearn.com › en › Discuss › 2305908 › converting-date-in-python-using-datetime-module
Converting date in Python using datetime module | Sololearn: Learn to code for FREE!
You can do this by using strftime(), that can use format specifiers: import datetime now_ = datetime.datetime.now() print(now_.strftime("Current Time: %I:%M:%S")) today_ = datetime.date.today() print("Today's Date:", today_) print(today_.st...
🌐
Vultr Docs
docs.vultr.com › python › third-party › pandas › to_datetime
Python Pandas to_datetime() - Convert to DateTime | Vultr Docs
December 9, 2024 - Start with a simple date string. Use to_datetime() to convert it to a DateTime object.
🌐
YouTube
youtube.com › watch
Python: Convert datetime to date using pandas - YouTube
Python: Convert datetime to date using pandashttps://analytics4all.org/2022/06/08/python-convert-datetime-to-date-using-pandas/
Published   June 8, 2022
🌐
Medium
ntsh-vicky.medium.com › basic-of-python-date-time-91349829971b
Basic Of Python — Date & Time
November 15, 2023 - Alternatively, if you need to compare the datetimes with time zone awareness, you can convert a naive datetime to an aware one by adding a timezone. ... To compare or perform operations on two datetime objects, ensure both are either naive or aware. If you’re working across time zones, it’s often best to work with aware datetime objects. Here’s an example where we ensure both datetimes are aware before comparing them: ... Working with dates and times in Python, particularly using the datetime module, can sometimes be challenging, and developers often encounter certain common errors or issues.