Functions used in the following examples are TIMEDIFF and DATEDIFF
select TIMEDIFF('2011-10-31 12:50:56' , '2011-09-23 12:50:21')
The above outputs : 838:59:59
select TIMEDIFF('15:50:56' , '12:55:21')
The above SQL outputs: 02:55:35
select DATEDIFF('2011-10-31 12:50:56' , '2011-09-23 12:50:21')
The above SQL outputs: 38
select DATEDIFF('2011-10-31' , '2011-09-23')
The above SQL outputs: 38
how i can calculate date and time difference in php diff will be count seconds also they plz give idea about that module .....
ReplyDeleteHi,
ReplyDeleteThere is a convenience method in php - 'date_diff'.
Pls look at http://php.net/manual/en/datetime.diff.php
The input this method are DateTime objects.
The output can be formatted in several types including sec.
Pls take a look at http://www.php.net/manual/en/datetime.format.php