Given a certain date, whats the easiest way to determine how many days until that date (in PHP)? I am trying to build a count-down widget, Thanks!
+2
A:
Don't treat dates as integers. Use your database, which has good support for dealing with calendars/time.
select datediff("2009-11-12", now())
troelskn
2009-03-17 15:07:14
unix timestamp FTW
andufo
2010-06-30 15:13:24
A:
PHP 5.3 has introduced the DateTime class that implements a 'diff' function. See http://www.php.net/manual/en/datetime.diff.php
schuilr
2009-03-17 15:12:56