[wp-trac] [WordPress Trac] #40653: Use PHP `DateTime` class API in `current_time()`

WordPress Trac noreply at wordpress.org
Tue May 28 10:49:07 UTC 2019


#40653: Use PHP `DateTime` class API in `current_time()`
------------------------------------------+------------------------------
 Reporter:  jdgrimes                      |       Owner:  (none)
     Type:  enhancement                   |      Status:  new
 Priority:  normal                        |   Milestone:  Awaiting Review
Component:  Date/Time                     |     Version:  1.0
 Severity:  normal                        |  Resolution:
 Keywords:  needs-unit-tests needs-patch  |     Focuses:
------------------------------------------+------------------------------
Changes (by Rarst):

 * keywords:  has-patch needs-unit-tests => needs-unit-tests needs-patch


Comment:

 Ok, I think this is going to lingering more than I'd like it to, so at
 least some fixup is in order (which gets easier with upcoming
 `wp_timezone()`).

 The challenge is how do we fix local time behavior without breaking WP
 timestamp behavior?

 I am of mind that `timestamp` or `U` (verbatim) formats without GMT flag
 should trigger a legacy WP timestamp path, everything else should produce
 ''correct'' local time for any format. We can document timestamp branch as
 discouraged and potentially formally deprecate it at a later time.

 Will take a stab on a patch.

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


More information about the wp-trac mailing list