Is it possible to make .NET create the following output?
DateTime.UtcNow.ToString() --> "2017-11-07T00:40:00.123456Z"
Of course there is always the possibility to use ToString("s") or ToString("yyyy-MM-ddTHH:mm:ss.fffffffK"). But is there a way to adjust the default-behaviour for the parameterless ToString-Method to the desired output?
I tried changing the CurrentCulture. But the best I got was "2017-11-07 00:40:00.123456Z". I did not find a way to change the separator between the date and the time from a space to "T".
c = new CultureInfo("en-US") { DateTimeFormat = { ShortDatePattern = "yyyy-MM-dd", LongTimePattern = "HH:mm:ss.FFFK" } }
– Kidskin