fork(14) download
  1. <?php
  2.  
  3. echo Date("Y-m-d", strtotime("2013-01-01 +1 Month -1 Day")) . "\n";
  4. // 2013-01-31
  5.  
  6. echo Date("Y-m-d", strtotime("2013-01-31 +1 Month -3 Day")) . "\n";
  7. // 2013-02-28
  8.  
  9. echo Date("Y-m-d", strtotime("2013-01-31 +2 Month")) . "\n";
  10. // 2013-03-31
  11.  
  12. echo Date("Y-m-d", strtotime("2013-01-31 +3 Month -1 Day")) . "\n";
  13. // 2013-04-30
  14.  
  15. echo Date("Y-m-d", strtotime("2013-12-31 -1 Month -1 Day")) . "\n";
  16. // 2013-11-30
  17.  
  18. echo Date("Y-m-d", strtotime("2013-12-31 -2 Month")) . "\n";
  19. // 2013-10-31
  20.  
  21. echo Date("Y-m-d", strtotime("2013-12-31 -3 Month")) . "\n";
  22. // 2013-10-01
  23.  
  24. echo Date("Y-m-d", strtotime("2013-12-31 -3 Month -1 Day")) . "\n";
  25. // 2013-09-30
  26.  
Success #stdin #stdout 0.02s 24448KB
stdin
Standard input is empty
stdout
2013-01-31
2013-02-28
2013-03-31
2013-04-30
2013-11-30
2013-10-31
2013-10-01
2013-09-30