-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdate_time.py
More file actions
33 lines (29 loc) · 782 Bytes
/
Copy pathdate_time.py
File metadata and controls
33 lines (29 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
""""
Author:Abhirami
date:08-10-24
"""
from datetime import datetime
current_time=datetime.now()
print(current_time)
format1=current_time.strftime("%Y-%m-%d %H:%M:%S")
format2=current_time.strftime("%m/%d/%Y")
format3=current_time.strftime("%A,%B %d,%Y")
format4=current_time.strftime("%A,%B %d,%Y %H:%M:%S %p")
format5=current_time.strftime("%a-%b-%d %H:%M:%S %Z %Y")
format6=current_time.strftime("%a-%b-%d %H:%M:%S %Z %Y")
format7=current_time.isoformat()
format8=current_time.strftime("%d")
format9=current_time.strftime("%H:%M:%S")
format10=current_time.strftime("%B")
format11=current_time.strftime("%Y")
print(format1)
print(format2)
print(format3)
print(format4)
print(format5)
print(format6)
print(format7)
print(format8)
print(format9)
print(format10)
print(format11)