Can I alter the standard output format of a DateTime for a specific culture. Example:
class Program
{
static void Main(string[] args)
{
PrintCultureDateTime("ca-ES");
PrintCultureDateTime("es-ES");
PrintCultureDateTime("en-US");
PrintCultureDateTime("en-GB");
PrintCultureDateTime("pt-PT");
}
public static void PrintCultureDateTime(string culture)
{
string result = new DateTime(2017, 10, 1).ToString("d",
CultureInfo.GetCultureInfo(culture));
Console.WriteLine(string.Format("{0}: {1}", culture, result));
}
}
Output:
ca-ES: 1/10/2017
es-ES: 01/10/2017
en-US: 10/1/2017
en-GB: 01/10/2017
pt-PT: 01/10/2017
What I want is to use two digits for day and month using standard "d" format or another standartd one, in order to fix the size of DateTime strings . Something like that output:
ca-ES: 01/10/2017
es-ES: 01/10/2017
en-US: 10/01/2017
en-GB: 01/10/2017
pt-PT: 01/10/2017