Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

compare current time with another time in php

//use new DateTime('now') for current
$current_time = new DateTime('2013-10-11 21:07:35');
$passed_time = new DateTime('2013-10-11 21:02:37');
$interval = $current_time->diff($passed_time);
$diff = $interval->format("%i%");


if($diff < 5){
 echo "online";
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #compare #current #time #time #php
ADD COMMENT
Topic
Name
7+7 =