How to get current date and time in Python?
from datetime import datetime, date, time
1) Print Current Date
2) Print Current Time
3) Print Full Current Date & Time
4) Print Year
5) Print Month
6) Print Day
7) Print Hour
8) Print Minute
9) Print Second
10) Print Weekday Number
11) Print Weekday Name
12) Custom Format — Date Only
13) Custom Format — Time Only
14) Custom Format — Date & Time
15) Milliseconds Included
16) AM/PM Format
17) Print Today’s ISO Format
18) Separate Date & Time Variables
19) Print Time Without Microseconds
20) Print Timezone-aware Now
🧠 Concepts Practiced
Concept
Code
📌 Starter Code Snippets
Last updated