fixed fatal error when date value is invalid and no format is provided

When no format is provided and value is a bad DateTime format it throw a fatal exception. Since we can't catch a fatal exception i test $value with strtotime. 

I added one test too. 

I never tried to contribute before so maybe i have all wrong... be indulgent :D
You should make sure that your code doesn't have trailing whitespaces.