date ("Ymd H:i:s", strtotime ("25-08-2011 17:31:17")-strtotime ("25-08-2011 17:30:30")); 

Conclusion 1970-01-01 03:00:47 Why is that? there must also be a 00:00:47

  • one
    Because datetime is counted from January 1, 70th year of the last century. And plus 3 hours of time. - Akina
  • You can get the difference between dates using the mktime function php.net/manual/ru/function.mktime.php For example, in your case, the difference in 47 seconds is obtained from the following expression: mktime (17, 31, 17, 8, 25, 2011) - mktime (17, 30, 30, 8, 25, 2011); - Alexander Chernin
  • It adds the offset of your time zone (+3) hours - KAGG Design
  • этот диапазон был ограничен датами 01-01-1970 до 19-01-2038. - believe - it was not difficult to open to spin and read - And
  • completed your code from the question, got 1970-01-01 00:00:47 - Lexx918

0