ISO 8601 into a datetime object using C#

Possible Duplicate:
How to create a .NET DateTime from ISO 8601 format

How can I parse a date string in ISO 8601 format into a datetime object using C#?


Use one of the ISO 8601 standard date and time format strings - "O", "o" , "S" and "s" when parsing the string (aka the Roundtrip format specifier) .

The pattern for this specifier reflects a defined standard (ISO 8601). Therefore, it is always the same regardless of the culture used or the format provider supplied.

DateTime dt = DateTime.ParseExact(iso8601String, "s", CultureInfo.InvariantCulture);
链接地址: http://www.djcxy.com/p/46544.html

上一篇: .net webApi ISO日期时间和IE8

下一篇: 使用C#将ISO 8601转换为日期时间对象