2009-10-05 18:11:08
2009-10-05 18:07:13
This should generate 235,how to do it ?
2009-10-05 18:11:08
2009-10-05 18:07:13
This should generate 235,how to do it ?
You can use strtotime() to do that:
$diff = strtotime('2009-10-05 18:11:08') - strtotime('2009-10-05 18:07:13')
strtotime("2009-10-05 18:11:08") - strtotime("2009-10-05 18:07:13")
PHP Date Time reference is helpful for things like this: PHP Date Time Functions
strtotime() is probably the best way.
$seconds = strtotime('2009-10-05 18:11:08') - strtotime('2009-10-05 18:07:13')