[wp-trac] [WordPress Trac] #45047: user_registered returned as UTC Time instead of Local Time

WordPress Trac noreply at wordpress.org
Wed Apr 22 15:52:04 UTC 2020


#45047: user_registered returned as UTC Time instead of Local Time
--------------------------+-----------------------------
 Reporter:  kcrnc         |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  Date/Time     |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  multisite
--------------------------+-----------------------------

Comment (by Rarst):

 I would prefer to drop `mysql2date()` there (and everywhere), it's very
 problematic. It expects a local time and produces a WP timestamp. Using it
 for UTC time is a case of compounding bugs ending up in "correct" result
 more by accident than design.

 Possibly replace with `date_create_from_format()` and explicit UTC time
 zone.

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


More information about the wp-trac mailing list