3 ms·
This also seems to affect PHP when using the formatting character 'o', which is PHP's version of the ISO-8601 year number. Using 'Y' instead is returning 2014.
by jontas 12y ago
This also seems to affect PHP when using the formatting character 'o', which is PHP's version of the ISO-8601 year number. Using 'Y' instead is returning 2014.
php > echo date('Y');
2014
php > echo date('o');
2015
- teleclimber 12y agoYup. Got bitten by that last year. When reading the docs [1] it's pretty obvious which one should be used so I am left wondering why I ended up with 'o' in my code. I suspect I copy-pasted something from some random blog post or whatever. Serves me right. :( [1] http://php.net/manual/en/function.date.php http://php.net/manual/en/function.date.php