Calculate days between date and today in PHP [duplicate]
问题 This question already has answers here : How to calculate the difference between two dates using PHP? (34 answers) Closed 7 years ago . If I have a given date in the format yyyy-mm-dd, how can I calculate the difference in days to the current date ? I just want to check whether this date is more than one week (7 days) old compared to the current date. 回答1: date_default_timezone_set('Europe/Warsaw'); $from = strtotime('2013-11-01'); $today = time(); $difference = $today - $from; echo floor(