[ create a new paste ] login | about

Link: http://codepad.org/L9NmTvQ1    [ raw code | output | fork ]

PHP, pasted on Jun 30:
1
2
3
4
5
<?php

$f = 1;
echo 'fails:' . date("m/Y", strtotime("04/2014 - $f Month")) . "\n";
echo 'works:' . date("m/Y", strtotime("april 2014 - $f Month"));


Output:
1
2
fails:01/1970
works:03/2014


Create a new paste based on this one


Comments: