Posted By

alexandrepayet on 08/18/10


Tagged

php time date timestamp calcul


Versions (?)

PHP : calcul sur des dates


 / Published in: PHP
 

  1. <?php
  2. $nextWeek = time() + (7 * 24 * 60 * 60);
  3. // 7 jours; 24 heures; 60 minutes; 60secondes
  4. echo 'Aujourd\'hui : '. date('Y-m-d') ."\n";
  5. echo 'Semaine prochaine : '. date('Y-m-d', $nextWeek) ."\n";
  6. // ou en utilisant strtotime():
  7. echo 'Semaine prochaine : '. date('Y-m-d', strtotime('+1 week')) ."\n";
  8. ?>

Report this snippet  

You need to login to post a comment.