As far as I see the the DateTime.ParseExact with "o" and "s" parameters is capable of parsing ISO 8601 extended format only.
How do I parse ISO 8601 both basic and extended formats using c#/.Net?
As far as I see the the DateTime.ParseExact with "o" and "s" parameters is capable of parsing ISO 8601 extended format only.
How do I parse ISO 8601 both basic and extended formats using c#/.Net?
Here is the class that I finally created to parse both basic and extended formats:
The Iso8601Formats.DateAndOrTime static property is probably the most useful in this class. Using the code:
I was able to parse the following ISO 8601 date/times:
This class however is still unable to parse date/times with a time zone specified and year absent, such as: