asp.net - Display only the Date in C# -


possible duplicate:
extract date part datetime in c#

i have code display date.

datetime dt = datetime.parseexact(date1,"ddmmyy",system.globalization.cultureinfo.currentculture); 

and gives me output of 6/12/2012 12:00:00 am.

but need display date only, how can remove time 1 display date?

use method toshortdatestring() of datetime

dt.toshortdatestring(); 

see here refs

the string returned toshortdatestring method culture-sensitive. reflects pattern defined current culture's datetimeformatinfo object.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -