formatting datetime data from a data reader field

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top