I need only date value part and time value part using ASP.NET C# -


i have 2 parameters 1 date , time, , need date value part , time values part.

my 2 parameters below.

 // date parameter   datetime dt = datetime.parseexact("01-jan-1999", "dd-mmm-yyyy", cultureinfo.invariantculture);   bo.dateused5 = dt;          // time parameter      string fromtiming = ddl_fromhours.selecteditem.tostring() + ":" +    ddl_fromminutes.selecteditem.tostring();     datetime interviewtime = convert.todatetime(fromtiming);//starttime bo.dateused4 = interviewtime;//interviewtime 

so need send mail candidate date part, should not contain time , time part, should not contain date.

are looking this:

datetime dt = datetime.parseexact("01-jan-1999", "dd-mmm-yyyy", cultureinfo.invariantculture); string maildate = dt.tostring("dd-mmm-yyyy");// give 01-jan-1999 string date = dt.tostring("dd-mm-yyyy"); // give 01-01-1999 

you can try using string.format()

string maildate = string.format("{0:dd-mm-yyyy}", dt); // give 01-01-1999 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -