[wp-trac] Re: [WordPress Trac] #3962: WordPress should adjust for DST ("location" appropriate)

WordPress Trac wp-trac at lists.automattic.com
Tue Mar 10 02:52:28 GMT 2009


#3962: WordPress should adjust for DST ("location" appropriate)
----------------------------+-----------------------------------------------
 Reporter:  iacas           |        Owner:  anonymous
     Type:  task (blessed)  |       Status:  reopened 
 Priority:  high            |    Milestone:  2.8      
Component:  Administration  |      Version:  2.1.2    
 Severity:  normal          |   Resolution:           
 Keywords:  needs-testing   |  
----------------------------+-----------------------------------------------

Comment(by sambauers):

 If you use DateTimeZone::listIdentifiers() which is it's OOP parent on php
 >= 5.3.0 then you can filter out by groups according to these constants
 http://www.php.net/manual/en/class.datetimezone.php  But that doesn't do
 exactly what you want anyway.

 Other than that, your manual approach is the only way I think. I'm not
 sure it's such a big performance problem anyway.

 If you want to save on execution time then you should probably filter out
 the zones you don't want on the first foreach loop in wp_timezone_choice()
 and filter using in_array() instead of the series of conditionals in your
 original patch.

 Filtering in the first loop will save a little memory (no point in storing
 things you won't use) and in_array() will be faster as it pulls all those
 conditions into compiled code (probably more friendly to php accelerators
 too).

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


More information about the wp-trac mailing list