I\'m trying to convert the following string to datetime. I\'ve searched high and low and can\'t find the exact formats string and I don\'t want to resort to parsing it manually.
Have you tried this:
DateTime.ParseExact("20110828T134108+0100", "yyyyMMdd'T'HHmmsszzzz", CultureInfo.InvariantCulture);
try this format: "yyyyMMdd'T'HHmmss"
The documentation on the format string is here: http://msdn.microsoft.com/en-us/library/8kb3ffffd4.aspx
That should get you started. :)
Have you tried this?
var date = DateTime.ParseExact( dateString
,"yyyyMMdd\THHmmsszzz"
,CultureInfo.InvariantCulture
);
From MSDN:
If format is a custom format pattern that does not include date or time separators (such as "yyyyMMdd HHmm"), use the invariant culture for the provider parameter and the widest form of each custom format specifier. For example, if you want to specify hours in the format pattern, specify the wider form, "HH", instead of the narrower form, "H".