Skip to content
  • Tutorials
    • c programming
      • libraries
    • c++
    • Linux
    • Python
    • batch programming
    • Technology
  • IDE
  • Tools
python datetime date only 1

python datetime date only

June 13, 2022 by Anurag batra
# Use the date() method:
datetime.datetime.now().date()

Here is what the above code is Doing:
1. We’re importing the datetime module.
2. We’re creating a datetime object by calling datetime.datetime.now().
3. We’re calling the date() method on that datetime object.

Categories Python Examples
Post navigation
for loop python start at 1
set the root directory when starting jupyter notebooks
© MyEduKit - 2022 . All Rights Reserved.