`MessageFormatter` uses default timezone to format dates
Open
Nobody has claimed this yet.
Extension: intl
Feature
Status: Needs Triage
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
Description
The following code:
<?php
date_default_timezone_set('UTC');
echo MessageFormatter::formatMessage(
'fr_FR',
'{datetime, time, short}',
['datetime' => new DateTimeImmutable('2023-03-27T12:00', new DateTimeZone('Europe/Paris'))]
);
Resulted in this output:
10:00
But I expected this output instead:
12:00
PHP Version
all
Operating System
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the provided PHP snippet and tracing the MessageFormatter date/time formatting path. Done means the DateTimeImmutable timezone is respected, producing 12:00 for the example, with regression coverage for the reported behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- internationalization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100