To calculate the days before a certain date, you can use subtraction and the TODAY function. In the generic version of the formula above, date is the later date. I've a date like this: What would be the most date = " "; $date_2 = date ("Y-m-d H:i:s");. cdate 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. This really depends on your definition "days until". Business Date Dialing Codes Distance Travel Time Weekday Week Number. Is there something wrong with the calculation Calculate how many days there are left until a certain date? Stack Overflow Questions Developer Jobs Documentation beta Tags Users. The Excel TODAY function returns the current date, updated continuously when a worksheet is changed or opened.