PHP : calcul sur des dates


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



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.