If I have a string that contain a date, like '29/01/21', how can I convert its format to a 4 year digit instead of 2 digits?
'29/01/21'
to
'29/01/2021'
Pythons datetime library might be helpful.
Please refer below code.
from datetime import datetime datetime.datetime.strptime('29/01/21', '%d/%m/%y').strftime("%M/%d/%Y")
1.4m articles
1.4m replys
5 comments
57.0k users