Fix for issue #156

Added a utility function to parse a string to a DateTime option, and used this to check for invalid headers.