[wp-trac] [WordPress Trac] #28614: Add microtime support to current_time()

WordPress Trac noreply at wordpress.org
Mon Jun 23 00:57:44 UTC 2014


#28614: Add microtime support to current_time()
-------------------------+-----------------------------
 Reporter:  uuf6429      |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Date/Time    |    Version:  3.9.1
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 `current_time()` is currently limited to precision to at most, seconds.

 I propose adding `current_time('microtime')` functionality.

 The proposed changed affects `wp-includes/functions.php`, line 67:

 {{{#!php
     case 'microtime':
         return ( $gmt ) ? microtime(true) : microtime(true) + (
 get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );
         break;
 }}}

 Also, considering this may require better performing code ... I was
 thinking that perhaps `get_option() ... etc` should be replaced with a
 cache (and `update_option()` should be able to update/reset the cache).

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


More information about the wp-trac mailing list