[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 05:13:06 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 dossy):

 `get_gmt_from_date()` and `get_date_from_gmt()` were already using PHP's
 Date/Time functions, so I figured it would be okay to use in
 `iso8601_to_datetime()` as well.

 Similarly, yes, the date/time functions can throw exceptions, and the
 other WP functions that I mentioned above don't catch them, either, so I
 was trying to stay consistent with what's already in the codebase.  I
 agree, personally, that the functions should catch and handle the
 exceptions, but I didn't want to reach into those other functions to
 change their implementations - it seems weird that one set of functions
 would catch exceptions while the others don't.

 And, yes, America/New_York has DST, but because our tests have specific
 dates in the tests, we already know if they're during the DST time of
 year, or not, therefore there's no need to use `UTC-5`.

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


More information about the wp-trac mailing list