Click here to Skip to main content
14,325,789 members
Rate this:
Please Sign up or sign in to vote.
See more:
I am using DateTimePicker , i set it's customFormat property to dd/MM/yyyy. In the system i have the format M/d/yyyy. How can i make the DateTimePicker independent from the systems one.

I have tried statements like

    MyDate.Format = DateTimePickerFormat.Custom;
    MyDate.CustomFormat="dd/MM/yyyy";
but it's doesn't work.
Posted

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

I have solved this . Before insert date in to table, and every where when i want to change format according sysytem then i changed it by this code and
String date = MyDate.Text;
DateTime paydate =Convert.ToDateTime(date,System.Globalization.CultureInfo.GetCultureInfo("hi-IN").DateTimeFormat);
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100