[wp-trac] Re: [WordPress Trac] #8662: current_time('timestamp') doesn't return the correct timestamp value

WordPress Trac wp-trac at lists.automattic.com
Wed Apr 22 09:51:30 GMT 2009


#8662: current_time('timestamp') doesn't return the correct timestamp value
--------------------------+-------------------------------------------------
 Reporter:  hudatoriq     |       Owner:  hudatoriq       
     Type:  defect (bug)  |      Status:  new             
 Priority:  high          |   Milestone:  2.8             
Component:  General       |     Version:  2.7             
 Severity:  major         |    Keywords:  has-patch tested
--------------------------+-------------------------------------------------
Changes (by Denis-de-Bernardy):

  * keywords:  has-patch reporter-feedback => has-patch tested
  * priority:  normal => high
  * severity:  normal => major


Comment:

 he's complaining that, on some/all servers, time() does not return a gm
 time, but the server time instead.

 there are many areas in WP (see #9588) where WP assumes that time()
 returns a GMT time, where in fact it returns the server time.

 On my laptop, for instance:

 {{{
 var_dump(time() == strtotime(gmdate("Y-m-d H:i:s"))); // false
 }}}

 I may be wrong of course, but I'm willing to take the bet that multitudes
 of cron and autosave related bugs are related to this and #9588. In
 particular ones where cron doesn't get fired when expected to, and
 autosaves that seem to get stored with a date set in the future.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/8662#comment:12>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list