[wp-trac] [WordPress Trac] #29063: function current_time( $type, $gmt = 0 ) don't return GMT if 'Y-m-d H:i:s' is pass as type

WordPress Trac noreply at wordpress.org
Tue Jul 29 20:24:15 UTC 2014


#29063: function current_time( $type, $gmt = 0 ) don't return GMT if  'Y-m-d H:i:s'
is pass as type
--------------------------+-----------------------------
 Reporter:  pbearne       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Hi Guys

 Have been trying to write unit tests for the function current_time() in
 the functions.php

 It works OK if the server/php timezone is GMT but if I run
 date_default_timezone_set('America/Los_Angeles'); and change the timezone
 it fails to pass the unit tests

 So here are the unit tests and patch that seems to fix it.

 It needs better eyes than mine to check this :-) as this a core function

 Paul

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


More information about the wp-trac mailing list