In Python, showing the day of the week as an integer using datetime.strftime() shows a different result than using datetime.weekday().
Originally, the ISO 8601 standard used 1 .. 7 to represent Monday through Sunday. For convenience, later on the interpretation 0=Sunday was permitted.
If you want to use something that is more consistent, try using isoweekday
The 0=Monday standard is the European convention. I guess that's no surprise :P