[wp-trac] [WordPress Trac] #39855: REST API: Add timezone offset to all date responses

WordPress Trac noreply at wordpress.org
Sun Feb 12 16:44:13 UTC 2017


#39855: REST API: Add timezone offset to all date responses
--------------------------+-------------------
 Reporter:  jnylen0       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  4.7.3
Component:  REST API      |    Version:  4.7
 Severity:  normal        |   Keywords:
  Focuses:  rest-api      |
--------------------------+-------------------
 Currently the REST API returns dates in the following format:
 `2016-12-12T14:00:00`.  This should really be `2016-12-12T14:00:00Z` for
 `date_gmt` or `2016-12-12T14:00:00-05:00` for `date`.

 Date/time values should always be stored and processed with their
 corresponding timezone offset (or at least a best guess).  This
 accomplishes a few things at once:

 - Exposes the best guess for the timezone offset of the `date` (non-UTC)
 field of a post or comment.  This information is currently not available
 anywhere else in the API.
 - Makes client-side datetime manipulation much easier and less error-
 prone.  See ticket:38342#comment:86.

 If we are going to make this change we need to do it soon.  Milestoning
 for 4.7.3 for discussion.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39855>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list