KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Got this working on php 5.3 $datetime1 = new DateTime("2011-10-10 10:00:00"); $datetime2 = new DateTime("2011-10-10 10:45:00"); $interval = $datetime1->diff($datetime2); $hours = $interval->format('%h'); $minutes = $interval->format('%i'); echo 'Diff. in minutes is: '.($hours * 60 + $minutes); How can i make it work on php 5.2 ? are there any equivalent functions available?? Got it working $date1 = "2011-10-10 10:00:00"; $date2 = "2011-10-10 10:11:00"; echo round((strtotime($date2) - strtotime($date1)) /60);
Tags (comma-separated)
Save Edits
Cancel