Your question literally states "then I will face an issue if the date is 2023-10-20". Have you even looked at the datetime module in python for formatting?
I'm going to ignore all of that (millions of people move between countries) but there is no directive to get the format you want in the base datetime module it seems. I'm not sure why you need this format in the first place
2023-10-20?datetimemodule in python for formatting?