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
When creating dates from PDF time strings, the following format is used: (D:20241122222357+08:00). To convert these strings to DateTimeImmutable objects, dates without timezones can be parsed with the following format:
\DateTimeImmutable::createFromFormat('\(\D\:YmdHis\)', '(D:20241122222357)'); // object(DateTimeImmutable) for
When modifying the format to include a timezone modifier (P), this breaks:
To allow the timezone modifier to be present, the format has to be modified, and the last \) escape for the closing bracket has to be removed in the format:
It looks like the "P" modifier swallows any closing brackets. This makes the format less readable, as the opening bracket has to be included (\(), while the closing bracket doesn't have to be included (\))
PHP Version
8.3.14
Operating System
No response
The text was updated successfully, but these errors were encountered:
Yeah timelib_parse_zone eats as many ( or horizontal whitespace as possible at the start, and then eats as many ) as possible at the end. One would assume that the number of ( and ) eaten must match, which would fix this issue. However, that may also break BC.
Description
When creating dates from PDF time strings, the following format is used:
(D:20241122222357+08:00)
. To convert these strings to DateTimeImmutable objects, dates without timezones can be parsed with the following format:When modifying the format to include a timezone modifier (
P
), this breaks:To allow the timezone modifier to be present, the format has to be modified, and the last
\)
escape for the closing bracket has to be removed in the format:It looks like the "P" modifier swallows any closing brackets. This makes the format less readable, as the opening bracket has to be included (
\(
), while the closing bracket doesn't have to be included (\)
)PHP Version
8.3.14
Operating System
No response
The text was updated successfully, but these errors were encountered: