This project has moved and is read-only. For the latest updates, please go here.

IsoDateTimeConverter vs ISO 8601

Jul 30, 2008 at 12:27 AM

When I look at the source code of IsoDateTimeConverter, it seems try to convert System.DateTime to ISO 8601 date format (e.g. 2008-04-12T12:53Z). But the const string DateTimeFormat is define as

private const string DateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK";

So it will convert datetime as 2008-04-12T12:53:11.00000000, not 2008-04-12T12:53:11Z. 

Is this a bug or by design?


Aug 2, 2008 at 9:37 AM
As far as I am aware both are valid under ISO 8601.

The Z is appended when the date time is UTC and fractional seconds after a dot are part of the standard.
Aug 4, 2008 at 4:07 AM
Hi James,

Thanks for your reply.

You're right - fractional seconds after a dot are part of the standard. 

So here is a feature request:  Is it possible make DateTimeFormat become public so that allow me to change the ISO 8601 style as I want.

Once again thank you for your excellent library.


Aug 4, 2008 at 10:39 AM
Done. Available in the latest source code on CodePlex.
Aug 4, 2008 at 10:56 PM
Thank you very much, James! I will check out the code.