I'm trying to write a XML parser for TV Schedule Pro (http://sourceforge.net/p/tvschedulerpro). One particular challenge is in Parsing the DateTime reported by the date elements.
According to the DTD file:
All dates and times in this DTD follow the same format, loosely based on ISO 8601. They can be 'YYYYMMDDhhmmss' or some initial substring, for example if you only know the year and month you can have 'YYYYMM'. You can also append a timezone to the end; if no explicit timezone is given, UTC is assumed. Examples: '200007281733 BST', '200209', '19880523083000 +0300'. (BST == +0100.)
This is challenging situation, where I initially thought about using DateTimeFormatInfo.GetAllDateTimePatterns and using DateTime.TryParseExact, the last line about the timezones and particular format with any delimiters make it impossible to use the above.
Is there a concise way to parse the above datetime specification or does one just need to keeping finding/adding various patterns to parse the strings as one finds them (looks like virtually endless combinations)