Make WordPress Core

Opened 3 years ago

Last modified 5 weeks ago

#57742 new defect (bug)

Post date time not updating after Timezone change

Reported by: nazmulhudadev's profile nazmulhudadev Owned by:
Milestone: Awaiting Review Priority: normal
Severity: major Version: 6.1.1
Component: General Keywords: has-patch dev-feedback
Focuses: administration, rest-api Cc:

Description

Please create a post first and check the date time from Dashboard post list view. Assume, it's 1:30pm.
Now, change the Timezone from the settings and check the previous post date time again and you will see the time is not updated.

I would expect that the published date would reflect the timezone change

Attachments (3)

57742.png (109.6 KB) - added by welcher 3 years ago.
Date in post list view that is not updating after the timezone change
Screenshot at Feb 17 11-19-56.png (315.8 KB) - added by hztyfoon 3 years ago.
timezone changing doesn't apply for older posts
57742.diff (1.2 KB) - added by sakibmd 3 years ago.
I have also checked @nazmulhudadev's PR and it's working great.

Download all attachments as: .zip

Change History (11)

@welcher
3 years ago

Date in post list view that is not updating after the timezone change

#1 @welcher
3 years ago

Created at WCAsia 2023 contributor day

#2 @welcher
3 years ago

Possibly related #52501

@hztyfoon
3 years ago

timezone changing doesn't apply for older posts

#3 @hztyfoon
3 years ago

I've also checked it from WCAsia 2023 contributor day & also found it on my end.

In the screenshot I shared:
the 2 posts was created within 2 minutes but before publishing the 2nd post the timezone was changed from 'UTC' to 'utc+7' but only the 2nd post's timezone changed but not the posts published before that.

I think all the post should be changed/converted to the new timezone.

This ticket was mentioned in PR #4090 on WordPress/wordpress-develop by @nazmulhudadev.


3 years ago
#4

  • Keywords has-patch added

This ticket was mentioned in PR #4092 on WordPress/wordpress-develop by @sakibmd.


3 years ago
#5

When we change GMT & click on save changes then all the post Date updated automatically based on the currently selected Timezone.

Trac ticket: https://core.trac.wordpress.org/ticket/57742

@sakibmd
3 years ago

I have also checked @nazmulhudadev's PR and it's working great.

#6 @hasanmisbah
3 years ago

I've tested @sakibmd's patch and @nazmulhudadev's PR both are working fine. thanks for your contribution.

#7 @welcher
3 years ago

This is great! The code looks fine to me. I took a brief look and didn't see any unit tests for the column_date function - do we need to add them?

Maybe one of the core committers who attended contributor day would be open to reviewing it as well? @adamsilverstein @desrosj @mikeschroder

#8 @vimalroy08
5 weeks ago

  • Focuses rest-api added
  • Keywords dev-feedback added
  • Severity changed from normal to major

I can confirm this issue still exists in the latest WordPress version (6.8.3 as of November 2025).
When changing the timezone from Settings → General, previously published posts do not have their displayed post_date updated accordingly — only newly published posts reflect the new timezone.

This can create confusion for editors working across regions, visitors reading the articles, and even affect the accuracy of event or incident timestamps — since the post list, REST API responses, and theme functions like the_time() or get_the_date() still reflect the old offset until each post is manually updated.

I’ve also tested this on a clean install with no plugins and default theme (Twenty Twenty-Five), and the behavior is consistent.

It seems the proposed patches from @nazmulhudadev and @sakibmd are still relevant and fix the issue. Can we please get a review or update on whether this can be merged into core?

Environment tested:

WordPress : 6.8.3
Web server : Apache (also on nginx/1.26.1)
PHP version : 8.3.24 (Supports 64bit values) (also on 8.2.27 (Supports 64bit values))
PHP SAPI : litespeed
Database Extension : mysqli
Server version : 10.11.14-MariaDB (also in 8.0.35)
Client version : mysqlnd 8.3.24 (also in mysqlnd 8.2.27)

Tested changing from UTC+4 (Dubai) to EDT (UTC-4)

Last edited 5 weeks ago by vimalroy08 (previous) (diff)
Note: See TracTickets for help on using tickets.