[Inconsistency] Time Inconsistencies When Local and Site Timezones Don’t Match #67982
Open
2 of 6 tasks
Labels
Internationalization (i18n)
Issues or PRs related to internationalization efforts
[Type] Bug
An existing feature does not function as intended
Description
Discovered this issue while working on #67751
All blocks using the
<time>
tag currently have an incorrectdatetime
attribute when the device's timezone differs from the timezone set in the site settings.For example, if the device timezone is
UTC+5:30
, thedatetime
picker converts the selected time toUTC+0
, as it displaysUTC+0
alongside the picker. However, in most blocks, the time selected in the picker is then formatted usingdateI18n()
, which assumes the input isUTC+5:30
. This results in an incorrect conversion toUTC-5:30
instead of the intendedUTC+0
.Step-by-step reproduction instructions
<time>
tagdatetime
picker converts it toUTC+0
since the sitetimezone
isUTC+0
( in this case ~2:30pm )datetime
attribute which again changes the timezone ( In this case ~9am )Screenshots, screen recording, code snippet
time.mov
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: