i’ve tried using date_diff and date_create to get a difference from two date that’s already converted to string. here’s the code: and i am getting this error: Answer You need to call DateInterval::format() to display that difference as a string. See the manual for all of the available formatting options.
Tag: date-math
php strtotime in seconds and minutes
i use ths method to find the difference between two timestamp and get the number of seconds between those two times, and i refresh the information with jquery like a counter. When the difference is more than 60 seconds, the $time comes back to 0, like a reset. i would like to display 1 min XX s for example Answer
PHP find the days until a date
I have to find the number of days until a date in timestamp format (mysql db) My problem is that if date now is 2013-12-01 09:59:00 the days are 15 while datenow is 2013-12-01 10:01:00 the days are 14. How could I make a difference only of the days without the time? Answer Using the DateTime class: returns