Advertisement
alpa_s

Untitled

Jan 30th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.26 KB | None | 0 0
  1. $dt1 = new DateTime();
  2. $dt2 = new DateTime();
  3. var_dump($dt1);
  4. echo '<br>';
  5. var_dump($dt2);
  6. echo '<br>';
  7. $month = 4;
  8. $hours = 24 * 30 * $month;
  9. $a = $dt1->modify("-{$hours} hours");
  10. $b = $dt2->modify("-{$month} month");
  11. var_dump($a);
  12. echo '<br>';
  13. var_dump($b);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement