79577593

Date: 2025-04-16 15:56:35
Score: 2
Natty:
Report link

To pull from @Rakesh 's answer I use this. The original question was from 2018 so I assume you'd prefer a more dynamic approach to attaching the year.

import datetime
s = "17 Apr"
print(datetime.datetime.strptime(s+" "+str(datetime.datetime.now().year),"%d %b %Y").strftime("%d-%m-%Y"))
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Rakesh
  • Low reputation (1):
Posted by: Deon Thompson