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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGridView date format

Status
Not open for further replies.

wooody1245

Programmer
Sep 13, 2005
28
US
I have a DataGridView that gets its data from a DataSet. Everything looks great except for the dates. All dates are formatted like this 2007-06-08T09:58:46.33-05:00. I would like to display the date like this: 06/08/2007 09:58 AM. I've tried formatting the datetime within the SQL query but I'm not having any luck. Anytime I return a type of datetime, no matter how I format it within the SQL query, it gets returned as 2007-06-08T09:58:46.33-05:00.
 
dataGridView1.Columns["MyDate"].DefaultCellStyle.Format="MM-dd-yy HH:ii:ss";

for more info on formatting dates check out this msdn article

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top