Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datatable - Format Datetime Field

Status
Not open for further replies.

Anddmx

Technical User
Apr 26, 2004
56
US
Hello,

I need help formating datetime column inside datatable.

This is what datetime looks like in row
{8/17/2007 12:00:00 AM}

Want to convert it to
{8/17/2007}

Sence I am looping through the datatable at once I can't use my regular method to convert datetime.

temp = Convert.ToDateTime(faxInfo["CIDate"].ToString());
arrivingDate = temp.ToString("MM/dd/yyyy");

What is the proper way to update datetime field in datatable so I get the proper format?

Thanks




 
The answer is : you don't!

You change the way the VIEW displays the date. A lot of controls have a display format or edit mask value. You will need to set that property and all the dates that are populated will automatically display in the specified format.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top