Does anyone know of a C# library that will correctly apply an ISO 8601 duration string to a DateTime using "nominal" values for Y, M, etc.?
Using System.Xml.XmlConvert::ToTimeSpan()
is faulty. It converts P1M to a Timespan of 30 days, which means it's using "accurate" values instead of "nominal" values, which isn't helpful in most of my use-cases:
I don't blame ToTimeSpan() for that, however, since TimeSpan is inadequate for storing nominal values. I need something I can apply to a DateTime and get a "nominally correct" outcome. Meaning "2020-01-01" with "P1Y" applied ends up as "2021-01-01".