-
Notifications
You must be signed in to change notification settings - Fork 305
Description
I have Python 3.X installed on Windows 10. Just started learning and made it to the site looking at date representation. I got an error using the format placeholders. Attempting to use the format string '%B %-d, %-I:%M' netted me:
ValueError: Invalid format string
I figured I did something wrong but after looking at StackOverflow turns out I could have used # instead of -.
I do not know the specifics of why this is not working but I thought it would be worth mentioning somewhere that perhaps:
Note: If you using windows and encounter
ValueError: Invalid format stringwhen trying to remove leading 0's try using the ampersand in place of the hypen e.g '%B %#d, %#I:%M'
I see that string (platform specific) on the page and a link to the documentation but it was not obvious on that page what I had to do either :/