It's a very simple and useful task to perform, just use time.strftime().
>>> from time import gmtime, strftime>>> strftime("%Y-%m-%d %H:%M:%S", gmtime())'2019-24-05 03:11:05'
Happy Learning, Cheers.
You can use below-mentioned code for that:-
>>> import datetime>>> datetime.datetime.now()>>> print(datetime.datetime.now())
>>> import datetime
>>> datetime.datetime.now()
>>> print(datetime.datetime.now())
You can use the following video tutorials to clear all your doubts:-