I have a problem stringifying dates in various cultures. Some time ago I posted a question on SO about it (C# DateTime ToString Standard culture format) and I implemented the solution posted there. But it's not working on Portuguese (for example) because ShortDatePattern is not equals than "d" predefined format:
CultureInfo ci = CultureInfo.GetSpecificCulture("pt-PT");
DateTime date = new DateTime(2019, 7, 26);
date.ToString("d", ci); // --> 26-07-2019
date.ToString(ci.DateTimeFormat.ShortDatePattern, ci); // --> 26/07/2019
How can I get the real format of a predefined style. I've seen the .Net source code of datetime.cs, and I can't understand how it works because following code "d" uses "ShortDatePattern" (https://referencesource.microsoft.com/#mscorlib/system/globalization/datetimeformat.cs,f4cacf1a27a6de16).
And I think that it depends on the machine that runs the code, because in some environments the "d" and ShortDatePattern is the same...