2014/04/22 06:00
The first bulleted link below has been living in my drafts like forever (i.e. somewhere since mid June 2009), so time to write a bit about ISO 8601 and .NET.
First a few links about converting a DateTime into ISO 8601 string format:
Some solutions use the “K” as a time zone specifier. At first, I couldn’t find any documentation for it, not even Google Search for Google Search for “ssK” DateTime ToString returns anything useful.
Later on, I found The “K” Custom Format Specifier in Custom Date and Time Format Strings.
So my preferred solutions for me are these:
System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ssK");System.DateTime.Now.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssK");I avoid these:
System.DateTime.Now.ToString("o");System.DateTime.Now.ToUniversalTime().ToString("s") + "Z";–jeroen
–jeroen
Posted by jpluimers
Categories: .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, ISO 8601, Software Development
Tags:
Mobile Site | Full Site
Get a free blog at WordPress.com Theme: WordPress Mobile Edition by Alex King.
thanks.
By asdasd on 2017/10/18 at 05:11