How to set datetimepicker value to only date in (.NET)
- by salhzmzm
Hi
I have DateTimePicker on my form and I set a value to the custom format property to "dd/MM/yyyy" ant when I run this code:
MessageBox.Show(dateTimePicker1.Value.ToString());
I get this value : "3/26/2010 1:26 PM".
How I can remove the time part from value.
I know we can use this method
dateTimePicker1.Value.ToShortDateString();
but I want to set the value property to this format "dd/MM/yyyy" so the output will be like this "26/3/2010", because I want to store the value in my DB (SQL)
How I can do that?