Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
CSS
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

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
C#
String date = MyDate.Text;
DateTime paydate =Convert.ToDateTime(date,System.Globalization.CultureInfo.GetCultureInfo("hi-IN").DateTimeFormat);
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900