formatting datetime data from a data reader field

  • Thread starter Thread starter Lauchlan M
  • Start date Start date
L

Lauchlan M

Hi

In an ASP.NET application, I am doing the following (dtrData is a data
reader that has been loaded with data already):

if (dtrData.Read())
{
lblEDPresentationTime.Text = (DateTime)
dtrData["EDPresentationTime"].ToString();
}

Currently this is giving me values such as "24/07/2002 9:17:52 PM"
displayed.

What I want to do is get the date and the time bits and format them as I
wish.

I figure the best way to do this is to get the EDPresentationTime field
value into a system DateTime variable and then use formatting on that.

What is the way to get the field value into a DateTime type?

Thanks

Lauchlan M
 
Back
Top