Friday, 21 December 2012

Find Current Culture in C#

Find Current Culture in C#




System.Threading.Thread t=System.Threading.Thread.CurrentThread;

//current culture datetime format
Console.WriteLine(t.CurrentCulture.DateTimeFormat.FullDateTimePattern);

//current culture  Name,display name and native name
Console.WriteLine(t.CurrentCulture.NativeName+" "+t.CurrentCulture.EnglishName+" "+t.CurrentCulture.DisplayName);

//current culture  Name,display name and native name
 Console.WriteLine(t.CurrentUICulture.NativeName + " " + t.CurrentUICulture.EnglishName + " " + t.CurrentUICulture.DisplayName);