PDA

Click to See Complete Forum and Search --> : display date and time in data grid


jeffcky
May 6th, 2002, 03:23 AM
hi!i need some help!when i retrieved the date from the database and display it in the data grid, the time keep showing as 12:00:00 AM. Actually i just want to display the date only but the time keep coming out after the date! Can anyone tell me what is the problem here and what can i do to make the time go away and only display the date?Thank you!

Patoooey
May 7th, 2002, 03:00 AM
Originally posted by jeffcky
hi!i need some help!when i retrieved the date from the database and display it in the data grid, the time keep showing as 12:00:00 AM. Actually i just want to display the date only but the time keep coming out after the date! Can anyone tell me what is the problem here and what can i do to make the time go away and only display the date?Thank you!



DateTime myDate = DateTime.Now;
Response.Write(myDate.ToString("d") + "<br>");

// can use any of the following to format a date.

// d Short Date
// D Long Date
// f Full (long date + short time)
// F Full (long date + long time)
// g General (short date + short time)
// G General (short date + long time)
// m, M Month/Day Date
// r, R RFC Standard
// s Sortable without TimeZone info
// t Short Time
// T Long Time
// u Universal with sort able format
// U Universal with Full (long date + long time) format
// y, Y Year/Month Date



John