DateTime::createFromFormat doesn't appear to be working correctly, does anyone know a reason and/or how to fix it?
Given this code:
var_dump(DateTime::createFromFormat('m', '02')->format('m'));
var_dump(DateTime::createFromFormat('n', '2')->format('n'));
My expected output would be
02
2
However I actually get:
03
3
Example: http://codepad.viper-7.com/e4hns6
I've tested this on a multitude of servers including:
- Win PHP 5.4
- Linux PHP 5.3
- Viper Codepad