Sunday, June 29, 2014

convert datetime format to date only in asp.net

  string sessionscheduleid, sessionname, sessionid, duration, startdate, enddate;
            DateTime fromdate, todate;
     
            fromdate = Convert.ToDateTime(hdffromdate.Value);
            todate = Convert.ToDateTime(hdftodate.Value);

            startdate = fromdate.ToShortDateString();
            enddate = todate.ToShortDateString();

No comments:

Post a Comment