- microtime: documentation ( source)
- floor: documentation ( source)
- date: documentation ( source)
- sprintf: documentation ( source)
<?php
//echo (new \DateTime())->format('d-m-Y_H:i:s.u');
//echo time();
//echo date("Y-m-d H:i:s.u");
$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("d-m-Y_H:i:s.u"); // note at point on "u"