tags:

views:

275

answers:

3

2009-10-05 18:11:08

2009-10-05 18:07:13

This should generate 235,how to do it ?

+8  A: 

You can use strtotime() to do that:

$diff = strtotime('2009-10-05 18:11:08') - strtotime('2009-10-05 18:07:13')
Paul Dixon
+1  A: 
strtotime("2009-10-05 18:11:08") - strtotime("2009-10-05 18:07:13")
John Burton
+3  A: 

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')
Andi