Add or Subtract Days from Date


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?
  2. echo 'Three days from now is: ' . date('m-d-Y', strtotime('+3 days')) . '<br />';
  3. echo 'Next Wednesday is: ' . date('m-d-Y', strtotime('next wednesday')) . '<br />';
  4. echo 'Three Saturdays ago was: ' . date('m-d-Y', strtotime('-3 weeks saturday')) . '<br />';
  5. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.