In this tutorial you will learn how to find PHP date with microseconds in a PHP web application .
PHP date microseconds
In this tutorial you will learn how to find PHP date with microseconds in a PHP web application . In this tutorial calculate current date with microseconds. The code of "php-date-microseconds.php" given below :
<?php
$time =microtime(true);
$micro_time=sprintf("%06d",($time - floor($time)) * 1000000);
$date=new DateTime( date('Y-m-d H:i:s.'.$micro_time,$time) );
print "Date with microseconds :<br> "
.$date->format("Y-m-d H:i:s.u");
?>
Output :
When run "php-date-microseconds.php" display output as :


[ 0 ] Comments