Lynn Emery

Lynn Emery

  • 1.8k
  • 47
  • 46.6k

Convert date to a short date

Mar 12 2013 5:01 AM
Hi I am passing data from a database to specific textbox which is placed on my asps page, via the following code:

if (dv.Table.Rows[0][67] ==  null)
  {
  dv.Table.Rows[0][67] =  "";
  DateTime  D7_Date =  (DateTime)dv.Table.Rows[0][67];
  }
  else
  {
  DateTime D7_Date =  (DateTime)dv.Table.Rows[0][67];
  TextBox35.Text = "" +  D7_Date;
  }
However the date format includes the time for example 27/01/2010 00:00:00
I only want the  textbox date field to show the date rather than the date and time.
Does anyone know where I convert the datetime field and how.

Thanks for your help in advance.

Answers (3)