9 lines
280 B
Python
9 lines
280 B
Python
class Solution:
|
|
def reformatDate(self, date: str) -> str:
|
|
month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
|
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
|
|
|
|
d = date.split(" ")
|
|
|
|
return f"{d[2]}-{month.index(d[1])+1:02}-{int(d[0][:-2]):02}"
|