[wp-trac] [WordPress Trac] #9588: time() is not GMT time()

WordPress Trac wp-trac at lists.automattic.com
Wed Dec 2 21:42:44 UTC 2009


#9588: time() is not GMT time()
--------------------------------+-------------------------------------------
  Reporter:  Denis-de-Bernardy  |        Type:  defect (bug)           
    Status:  closed             |    Priority:  normal                 
 Milestone:  2.9                |   Component:  Date/Time              
   Version:  2.8                |    Severity:  normal                 
Resolution:  fixed              |    Keywords:  has-patch needs-testing
--------------------------------+-------------------------------------------

Comment(by Otto42):

 No, my concern isn't PHP4, it's the fact that the output of time() is
 going to change midway through WordPress' execution.

 If you're setting the default to UTC early on, then resetting it later
 (for that 23/24ths of the world not in GMT time), then time() will give
 one answer at one point and a different answer later in the process. If
 anywhere you happen to compare the values from before and after that
 point, you're going to get weird results.

 This can still cause problems on PHP5 setups. Those instances using time()
 need to be examined to see if they should be using gmtime() instead.

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


More information about the wp-trac mailing list