Skip to content

Commit 59a04e1

Browse files
committed
time _formet
1 parent 6053ebf commit 59a04e1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

time_format.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
'''
2+
Write a Python program to convert a date of yyyy-mm-dd format to dd-mm-yyyy format.
3+
'''
4+
5+
try:
6+
import datetime
7+
8+
input_date=list(map(int,input().split("-")))
9+
10+
date=datetime.datetime(2012,input_date[1],input_date[2])
11+
12+
print(date.strftime("%d-%m-%Y"))
13+
14+
except Exception as e:
15+
16+
print("Error:",e)

0 commit comments

Comments
 (0)