Get Current Date and Time
PUBLISHED ON APRIL 9, 2020
This python tutorial help to get the current date using python 3.The Python datetime class can be used to get and manipulate date and time.This libs provides a lot of methods and properties to express the date and time in programs in a variety of formats.
The today()
method of datetime class can be used to get the current date and time in python application. You can format date and time in different ways using built-in date time format specifiers or directives in Python.
Current Date and Time in Python Using datetime.today() Method
Results:
Format Current Date in Python Using strftime Function
The strftime
method is used to format a date in Python.You can convert a date into any possible desired format by using this method.You can pass date format specifiers or directives to format the date into desired format.
Result
Reference : https://www.pythonpip.com/python-tutorials/get-current-date-and-time-with-examples/
Last updated