Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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


Yup. 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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: