aboutsummaryrefslogtreecommitdiff
path: root/challenge-347/eric-cheung/python/ch-1.py
blob: 494a0ea2e0945b70ed6055311fbb401d3f46d8ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from datetime import datetime
from dateutil.parser import parse

## strInputDate = "1st Jan 2025"  ## Example 1
## strInputDate = "22nd Feb 2025"  ## Example 2
## strInputDate = "15th Apr 2025"  ## Example 3
## strInputDate = "23rd Oct 2025"  ## Example 4
strInputDate = "31st Dec 2025"  ## Example 5

strOutputDateFormat = "%Y-%m-%d"

objDate = parse(strInputDate)

print (objDate.strftime(strOutputDateFormat))