Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

strtotime returns false when string includes narrow non breaking space character #11600

Closed
@myleshyson

Description

@myleshyson

Description

This is kind of related to#9799

With theICU 72.1 update, it replaces a ascii space character with a narrow non-breaking space unicode character for intl space So something like

(newIntlDateFormatter('en_US', -1,3))->getPattern();

will returnh:mm\u202fa instead ofh:mm a.

When creating date strings based off that pattern with the NNBS character, and then passing intostrtotime,strtotime returns false.

With the ICU update, I think functions likestrtotime should support parsing the NNBS character.

The following code:

<?php$pattern = (newIntlDateFormatter('en_US', -1,3))->getPattern();$timeString =date($pattern,date('now'));$timestamp =strtotime($timeString);

Resulted in this output:

false

But I expected this output instead:

a unix timestamp

PHP Version

8.2.8

Operating System

Redhat Enterprise 8.8

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp