[wp-trac] [WordPress Trac] #61908: wp_date does not support micro seconds.

WordPress Trac noreply at wordpress.org
Thu Aug 22 12:02:49 UTC 2024


#61908: wp_date does not support micro seconds.
---------------------------+-----------------------------
 Reporter:  dpeterson1971  |      Owner:  (none)
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Date/Time      |    Version:  6.6
 Severity:  normal         |   Keywords:  needs-patch
  Focuses:                 |
---------------------------+-----------------------------
 // This fails because of this line.
 $date = wp_date('Y-m-d H:i:s.u',microtime( true ));

 if ( null === $timestamp ) {
     $timestamp = time();
 } elseif ( ! is_numeric( $timestamp ) ) {
     return false;
 }
 // Should be changed to this.
 if ( null === $timestamp ) {
     $timestamp = time();
 } elseif ( ! is_numeric( $timestamp ) || ! is_float($timestamp) {
     return false;
 }

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


More information about the wp-trac mailing list