[wp-trac] [WordPress Trac] #62400: RSS Block showing date in UTC when pubDate in feed is not

WordPress Trac noreply at wordpress.org
Wed Nov 13 10:17:35 UTC 2024


#62400: RSS Block showing date in UTC when pubDate in feed is not
--------------------------+------------------------------
 Reporter:  kaitohm       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Date/Time     |     Version:  6.7
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by narenin):

 Hi @kaitohm

 I have tried to replicate this issue and I am able to replicate this at my
 end too.


 == Environment

 **WordPress:** 6.7-beta1-59152-src
 **PHP:** 8.3.7
 **Server:** nginx/1.25.4
 **Database:** mysqli (Server: 8.3.0 / Client: mysqlnd 8.3.7)
 **Browser:** Chrome 125.0.0.0
 **OS:** macOS
 **Theme:** Twenty Twenty-One Version 2.2
 MU Plugins: None activated
 Plugins:



 Also it looks like this is happening because we are using **date_i18n()**
 function in WordPress formats a date according to the locale and the
 settings defined in WordPress, but it does not automatically adjust the
 time according to the timezone set in WordPress settings (**Settings >
 General > Timezone**). It relies on the get_option( 'timezone_string' ) or
 get_option( 'gmt_offset' ) to determine the correct time zone. However,
 the date_i18n() function formats the date based on the server time (which
 could be in UTC or any other server timezone) unless you explicitly adjust
 for timezones.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62400#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list