The Wiert Corner – irregular stream of stuff


Home | Pages | Archives


In C#, given a DateTime object, how do I get a ISO8601 date in string format? – Stack Overflow

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:

I avoid these:

–jeroen

–jeroen

Rate this:

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:

One Response to “In C#, given a DateTime object, how do I get a ISO8601 date in string format? – Stack Overflow”

  1. thanks.

    By asdasd on 2017/10/18 at 05:11

Leave a Reply



Mobile Site | Full Site


Get a free blog at WordPress.com Theme: WordPress Mobile Edition by Alex King.