php में मिलीसेकंड के साथ माइक्रोटाइम और डिस्प्ले डेट को घटाएं कैसे?php में मिलीसेकंड के साथ माइक्रोटाइम और डिस्प्ले डेट को घटाएं कैसे?
उदाहरण के लिए: मैं अंत की तारीख और समय
$endtime = 2012-02-21 10:29:59;
तो मैं आज की तारीख है या microtime से परिवर्तित साथ प्रारंभ दिनांक
$starttime = 2012-02-21 10:27:59.452;
function getTimestamp()
{
$microtime = floatval(substr((string)microtime(), 1, 8));
$rounded = round($microtime, 3);
return date("Y-m-d H:i:s") . substr((string)$rounded, 1, strlen($rounded));
}
echo getTimestamp(); //sample output 2012-02-21 10:27:59.452
अब मैं घटाना चाहते हैं निर्धारित किया है: $ finaldate = $ अंतराल - $ स्टार्टटाइम; 00: 00: 02,452