Code 45: Python program to print the current Date and Time | Datetime Module | 365 Days of Code

Veröffentlicht am: 14 Februar 2021
auf dem Kanal: Code House
456
4

Here is the program to print the current Date and Time using Python.
Code -
import datetime
curr_dt = datetime.datetime.now()
print(curr_dt) # Complete Date and Time
print(curr_dt.day) # Only Date
print(curr_dt.month) # Only Month
print(curr_dt.year) # Only Year
print(curr_dt.hour) # Only Hour
print(curr_dt.minute) # Only Minutes
print(curr_dt.second) # Only Seconds

Thanks


Auf dieser Seite können Sie das Online-Video Code 45: Python program to print the current Date and Time | Datetime Module | 365 Days of Code mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Code House 14 Februar 2021 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 456 Mal angesehen und es wurde von 4 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!