I have this code:
var ci = new CultureInfo("it-IT", false);
Thread.CurrentThread.CurrentCulture = ci;
Thread.CurrentThread.CurrentUICulture = ci;
var format = "HH:mm\\:ssZ";
var formatted = DateTime.Now.ToString( format, ci );
and... formatted happens to be 09:08:32Z
on my machine which has default culture different from "Italy". MSDN says that colon is a format specifier and provides a sample of how an unescaped colon is formatted as a dot with "it-IT" culture (the one I have in the code above).
In my code I have one colon character escaped and one unescaped and they are both formatted as a colon.
Why does it happen? Why is thread current culture seemingly being ignored?