You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From the PHP manual, the # should allow the following separation characters:
One of the following separation symbol: ;, :, /, ., ,, -, ( or )
This appears to include space, between . and -, but from the code above it doesn't parse the date string with a space. If I replace the format string with '!d M Y H#i ' it works as expected, so the : in the time is being handled by #, and the numeric parts fit the date format characters.
If I replace the spaces in the date string with - then it works as expected, so it's not anything else in the date string causing the issue.
Thank you for the quick reply. I see now, it's not a space between commas, it's a comma between commas where the space is just padding after the previous comma ... doh.
Would adding space be considered for a future version? It might be useful to avoid having to use multiple formats to check for valid user entries in form submissions for dates, as in my example spaces and hyphens are easily interchangeable without changing the meaning of the date.
Description
The following code:
Resulted in this output:
But I expected this output instead:
From the PHP manual, the # should allow the following separation characters:
This appears to include space, between . and -, but from the code above it doesn't parse the date string with a space. If I replace the format string with '!d M Y H#i ' it works as expected, so the : in the time is being handled by #, and the numeric parts fit the date format characters.
If I replace the spaces in the date string with - then it works as expected, so it's not anything else in the date string causing the issue.
PHP Version
PHP 8.3.9
Operating System
Windows Server 2016 ( IIS using PHP binaries from http://windows.php.net )
The text was updated successfully, but these errors were encountered: