Skip to content
Advertisement

PHP find the days until a date

I have to find the number of days until a date in timestamp format (mysql db)

JavaScript

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?

Advertisement

Answer

Using the DateTime class:

JavaScript

returns

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement