[wp-trac] [WordPress Trac] #28636: Add functions for working with local dates and times

WordPress Trac noreply at wordpress.org
Mon Aug 26 10:46:26 UTC 2019


#28636: Add functions for working with local dates and times
-------------------------+---------------------
 Reporter:  mboynes      |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:
Component:  Date/Time    |     Version:  2.9
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+---------------------
Changes (by Rarst):

 * keywords:  2nd-opinion has-patch has-unit-tests =>


Comment:

 I looked over the suggested patch, in context of current work on the
 component. In general I feel that writing API for ''just'' local time zone
 is a little too narrow. We need to balance between allowing for
 ''arbitrary'' time zone (use case poorly served in existing API) and not
 reinventing upstream `DateTime` functionality too much.

 I agree that `wp_date()` is necessary, but for ''localized'' output, in
 other words a less problematic version of `date_i18n()`. This is
 definitely in my plans to work on.

 On the fence about `wp_strtotime()` because now it's possible to reduce it
 to mere `new DateTime( $input, wp_timezone() )`. And if you routinely need
 to parse insufficient inputs are the problem really, not parsing them.
 Will consider if dedicated parsing function would help while I work
 through fixing up old API functions.

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


More information about the wp-trac mailing list