lblAppointmentDate.Text = dt.Rows[0]["AppDate"].ToString();
This is my code giving the output as:
AppointmentDate: 11/19/2014 12:00:00 AM.
I want only Date as 19/11/2014
.
lblAppointmentDate.Text = dt.Rows[0]["AppDate"].ToString();
This is my code giving the output as:
AppointmentDate: 11/19/2014 12:00:00 AM.
I want only Date as 19/11/2014
.
You can format the date however you like.
Use ToString() on the DateTime and pass in the appropriate format string.
Try one of the format strings from here: http://msdn.microsoft.com/en-us/library/8kb3ddd4%28v=vs.110%29.aspx
someDateTime.ToString("MM/dd/yyyy)
You need to format it like following. Before that don't forget to convert to datetime
type. Following is just an example only.
DateTime dt = DateTime.Now;
Console.WriteLine(dt.ToString("dd/MM/yyyy"));