Fix for issue #156

Added a utility function to parse a string to a DateTime option, and used this to check for invalid headers.

I have no idea how to write a test for this, although I suspect we probably should.
Since you're not using the result outside of the match, you could inline it inside the match expression.