How to make the short date format without time showing

  • Thread starter Thread starter Henry Lee
  • Start date Start date
H

Henry Lee

hi , all
In ASP2.0 , the date object always showing like "3/27/2006 12:00:00 AM"
How to remove "12:00:00 AM" and only make it shows "3/27/2006" ?
Thanks very much
Henry
 
<the date>.tostring("d") or you could do a <the date>.tostring("mm/dd/yyyy")
 
Hello Henry,

You can get the short date formate from the datetime object by calling the
DateTime.ToShortDateString() method. It is also the equivalent of calling the
DateTime.ToString("d", null) method. Check out the help file for more
information on Formatting Overview.
 

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

Back
Top