[wp-trac] [WordPress Trac] #35053: XML-RPC when post with date_created_gmt, its post_date will gmt date not local date

WordPress Trac noreply at wordpress.org
Sat Jan 2 07:04:48 UTC 2016


#35053: XML-RPC when post with date_created_gmt, its post_date will gmt date not
local date
------------------------------------------+-----------------------------
 Reporter:  hnle                          |       Owner:  wonderboymusic
     Type:  defect (bug)                  |      Status:  assigned
 Priority:  normal                        |   Milestone:  4.4.1
Component:  XML-RPC                       |     Version:  4.4
 Severity:  normal                        |  Resolution:
 Keywords:  has-unit-tests needs-testing  |     Focuses:
------------------------------------------+-----------------------------

Comment (by smerriman):

 Replying to [comment:19 dd32]:
 > The behaviour previous was well known as buggy, but consistent, this has
 simply changed it to be buggy in a different way.

 I can see now why what I thought was the fix is flawed and both new and
 old are buggy, but I disagree that the previous approach was consistent.
 As per #30429, with the old approach it was ''impossible'' to get a
 consistent value for post_date and post_date_gmt in the database if you
 pass the post_date parameter (and not post_date_gmt), unless your site was
 running in the GMT timezone. One of them was guaranteed to be incorrect.

 With the current approach if post_date is used, it is consistent and
 correct when a local time is passed to post_date, and buggy if you try to
 pass things in another timezone format (as per redsweater's comment). I'm
 probably missing a use-case but I would have thought that's where you'd
 use post_date_gmt; you're using post_date specifically because you do want
 a local time.

 However, my approach was never meant to affect when post_date_gmt was
 passed. Perhaps a simpler quick-fix would be to apply the previous logic
 only when post_date_gmt is empty.

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


More information about the wp-trac mailing list