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

Add support for modifiers to remove leading zeros or convert to spaces #1

Merged
merged 1 commit into from
Mar 17, 2022

Conversation

the-mars
Copy link
Contributor

The buildin strftime currently supports modifiers after the % sign. They are not documented at php.net/manual/en/function.strftime but they work on Linux and I have seen code which is using it.

For example %-d will remove a leading zero if the day of month <10. While %_d will replace the leading zero by a space. I found in a comment that on Windows %#d is doing the same as %-d, so I added it too. This will make it platform-independent ;-)

@alphp
Copy link
Owner

alphp commented Mar 17, 2022

Thanks for the pull request.
This has made me realize that I need to do some tests to avoid breaking what already works.

@alphp alphp merged commit 4707884 into alphp:master Mar 17, 2022
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

Successfully merging this pull request may close these issues.

3 participants