fixed the conversion of the special '0000-00-00 00:00' date

This PR reverts #1234 and add supports for PHP 5.5 is a simpler way. This also fixes #1241 and closes #1242.