Modify microseconds of a PHP DateTime object I have a PHP DateTime object with microseconds created as follows: $time = microtime(true); $microseconds = sprintf('%06d', ($time - floor($time)) * 1000000); $dt = new DateTime(date('Y-m-d H:i:s.' . $microseconds, $time)); How can I modify the microseconds value of $dt, without creating a completely new DateTime instance? Answer: You can't. There are three methods that can modify the value of a DateTime instance: add, sub and modify. We can rule out add and sub immediately because they work in terms of a DateInterval which does not have sub-second precision. modify accepts