-1

My requirement is to get DateTime in given locale and I am trying to achieve this by using below code

var d1 = DateTime.Now;
CultureInfo culture = new CultureInfo("en-NZ");
var da = d1.ToString("d1", culture);
Console.WriteLine("Output" + da);

output: Friday, 15 January 2021 11:55 pm

Its working fine for some cultures like "to,en-NZ,en-AU,de-DE" but its not working for "fr-CA, en-CA"

var d1 = DateTime.Now;
CultureInfo culture = new CultureInfo("en-CA");
var da = d1.ToString("d1", culture);
Console.WriteLine("Output" + da);

Output: 15 janvier 2021 23:55

For Fr-CA and en-CA ** I am not getting Day of week**

Could someone help me with this issue?

1 Answers1

0

The reason that day of the week is not showing is my application is running on .NET framework so framework/.NETCore3.1/.. do not support day of the week for all cultures

If we run the same application on .NET5, its supports day of the week for all cultures