I have a field in database that has type of datetime in which I add time when user visit a page. When user again comes I want to check the interval between his first visit and c
If you have PHP >= 5.3 you can use DateTime objects and functions:
$visit = DateTime::createFromFormat('Y-m-d H:i:s', '2011-03-04 00:25:01'); $now = new DateTime("now"); $diff = $now->diff($visit);