I have written below code to display a leading zero when the string representation of date has less than two digits?
'{}-{}-{:02d}'.format('6th', 'Jun', '1933')
But it is failing with an error:
ValueError: Unknown format code 'd' for object of type 'str'