2
dateTimePicker1.Format = DateTimePickerFormat.Custom;
dateTimePicker1.CustomFormat = "yyyy-MM-dd";
2
hi,
in application by default datetime formate is always shows system datetime format,
if you wanted to convert it to any format just use .ToString() method,
try as below you will get string datetime in that format,
- DateTime DOBDate = DateTime.Parse(strdob);
- string datetime=DOBDate.ToString("yyyy-MM-dd");
and this datetime you can show it in read only text box
1
hi,
if you wanted just display then add it to label
- DateTime DOBDate = DateTime.Parse(strdob);
- lblnmae.Text=DOBDate.ToString("yyyy-MM-dd");
1
or if you are using datetime picker then try below code
dateTimePicker1.Format = DateTimePickerFormat.Custom;
dateTimePicker1.CustomFormat = "yyyy-MM-dd";