In the example you gave, it is correctly returning false. The function example is comparing a string to a known date format. I suggest reading the documentation on the date format to see why you're making the wrong assumption.