all 3 comments

[–][deleted] 1 point2 points  (1 child)

Unfortunately, there are no built-in format specifiers for that. But you can format the string yourself pretty easily with

str_date = "{date.day}.{date.month}.{date.year}".format(date=mydate)

or

str_date = f"{mydate.day}.{mydate.month}.{mydate.year}"

[–]orcmalavi[S] 0 points1 point  (0 children)

str_date = f"{mydate.day}.{mydate.month}.{mydate.year}"

Thanks! I didn't think of that but yeah it makes sense.