note 93891 added to function.date

From: Date: Mon, 05 Oct 2009 19:13:27 +0000
Subject: note 93891 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-161372@lists.php.net to get a copy of this message
To actually make use ot the "u" (microsecond) you need to use the DateTime object and not the date() function. For example <?php $t = microtime(true); $micro = sprintf("%06d",($t - floor($t)) * 1000000); $d = new DateTime( date('Y-m-d H:i:s.'.$micro,$t) ); print $d->format("Y-m-d H:i:s.u"); ?> ---- Server IP: 209.41.74.194 Probable Submitter: 74.202.106.37 ---- Manual Page -- http://www.php.net/manual/en/function.date.php Edit -- https://master.php.net/note/edit/93891 Del: integrated -- https://master.php.net/note/delete/93891/integrated Del: useless -- https://master.php.net/note/delete/93891/useless Del: bad code -- https://master.php.net/note/delete/93891/bad+code Del: spam -- https://master.php.net/note/delete/93891/spam Del: non-english -- https://master.php.net/note/delete/93891/non-english Del: in docs -- https://master.php.net/note/delete/93891/in+docs Del: other reasons-- https://master.php.net/note/delete/93891 Reject -- https://master.php.net/note/reject/93891 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#161372) next »