code_junkie

PHP If Date Is >13 Days Ago

Nov 13th, 2011
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. SELECT * FROM links WHERE (TO_DAYS(NOW()) - TO_DAYS(date))>13
  2.  
  3. $date = '2008-11-05';
  4. if (strtotime("now") > strtotime("+13 days", strtotime($date))) {
  5. //Do something
  6. }
  7.  
  8. $age=time() - strtotime($date);
  9. if ($age > (13*86400))
  10. {
  11. //do something
  12. }
  13.  
  14. SELECT *, DATEDIFF(datecolumn,CURDATE()) AS days_diff FROM links
Add Comment
Please, Sign In to add comment