{"issue":{"user":{"id":614728,"login":"Sironfoot","url":"https://api.github.com/users/Sironfoot","avatar_url":"https://secure.gravatar.com/avatar/0ef5486e46714bb862bc32e2e4321915?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"0ef5486e46714bb862bc32e2e4321915"},"milestone":null,"created_at":"2011-12-20T19:18:45Z","title":"ICsvReader.TryGetField<DateTime> should fail for an invalid DateTime (blank strings, null etc.)","labels":[],"state":"open","updated_at":"2011-12-21T12:49:35Z","id":2616908,"html_url":"https://github.com/JoshClose/CsvHelper/issues/24","closed_at":null,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"body":"    reader.TryGetField<DateTime>(fieldName)\r\n\r\n...should return false (i.e. fail to parse to a DateTime for fields that are blank, null, invalid dates etc.). Instead it returns the date *\"1/1/0000 00:00:00\"*. Note that other value types (int, bool etc.) work correctly, .TryGetField<int> will return false for blank/null fields.\r\n\r\nE.g. consider the following CSV\r\n\r\n    IntType, DateTimeType\r\n    lalala,\"    \"\r\n    1234,\"2011-12-20\"\r\n\r\nFor the first row:\r\nreader.TryGetField<int>(\"IntType\", out value) will return false, but\r\nreader.TryGetField<DateTime>(\"DateTimeType\", out value) will return true and 'value' will be DateTime.MinValue\r\n\r\nBoth return correct results for the second row.\r\n\r\nNote: I'm thinking that the behaviour for TryGetField<DateTime> should be inline with DateTime.TryParse() method in the .NET framework.\r\n\r\nPS: Excellent library though, keep up the good work :-)","number":24,"url":"https://api.github.com/repos/JoshClose/CsvHelper/issues/24","comments":3,"assignee":null},"comment":{"user":{"id":614728,"login":"Sironfoot","url":"https://api.github.com/users/Sironfoot","avatar_url":"https://secure.gravatar.com/avatar/0ef5486e46714bb862bc32e2e4321915?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"0ef5486e46714bb862bc32e2e4321915"},"created_at":"2011-12-21T12:49:35Z","updated_at":"2011-12-21T12:49:35Z","id":3233236,"body":"Thanks for looking into this. Right now I have a work around for DateTime columns in my codebase, so it's not urgent from my end. Cheers!","url":"https://api.github.com/repos/JoshClose/CsvHelper/issues/comments/3233236"},"action":"created"}