Skip to content

Setting date time format of date picker control

Pravara Patil

Asked Feb 20, 2009, 2:39 AM EST1 answer
Share
LinkedInX

Hi,

I m using date picker control in my windows application. i want to set the date time format according to the regional settings of the system. can someone please help me in resolving this issue.

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Niradhip Chakraborty
    0
    You can make use of the CultureInfo.CurrentCulture object for regional
    setting checks. The following code excerpt will output the short date format
    for the current user (dd/MM/yyyy for en-GB):

    using System.Globalization;
    .....
    CultureInfo ci = CultureInfo.CurrentCulture;
    Console.WriteLine(ci.DateTimeFormat.ShortDatePatte rn);
    0