chevron_left
Documentation
0
0
0
new
Python Datetime | today method
Programming
chevron_rightPython
chevron_rightStandard Library
chevron_rightDatetime
chevron_rightDocumentation
schedule Mar 10, 2022
Last updated Python
Tags tocTable of Contents
expand_more The class method date.today()
can be used to return the current local date.
Parameters
None.
Return value
Returns a date
object representing current local date.
Examples
To return the current local date:
from datetime import datecurrent_date = date.today()print(current_date)
2020-03-20
Note that current_date
here is timezone-naive.
Published by Arthur Yanagisawa
Edited by 0 others
Did you find this page useful?
Ask a question or leave a feedback...
Official Python Documentation
https://docs.python.org/3/library/datetime.html#datetime.date.today