Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dealing with leading 0's on Windows #23

Open
NegativeZero000 opened this issue Apr 23, 2018 · 1 comment
Open

Dealing with leading 0's on Windows #23

NegativeZero000 opened this issue Apr 23, 2018 · 1 comment

Comments

@NegativeZero000
Copy link

NegativeZero000 commented Apr 23, 2018

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 string when 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 :/

@ShervinDD
Copy link

This needs to be clearer on the page. I didn't realise I had to use a # for Windows because I missed that (Platform Specific) had its own explanation at the bottom of the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants