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(); the string returned toshortdatestring method culture-sensitive. reflects pattern defined current culture's datetimeformatinfo object.
Comments
Post a Comment