0
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.

Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179
vicky
  • 33
  • 1
  • 2
  • 6

2 Answers2

1

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)
TGH
  • 38,769
  • 12
  • 102
  • 135
0

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"));
Arindam Nayak
  • 7,346
  • 4
  • 32
  • 48