Search code examples
c#asp.netdatetimedatetimepicker

how to get datetimepicker value with Date and current time


i have used the GMDatepicker. i need to take the datetime value along with date.

my code:

DateTime dateval= ((GMDatePicker)GrdDynamicControls.FooterRow.FindControl("frmDateTime")).Date;

this gives me the date 6/26/2010 12.00pm. and not the current time.

how to get the date with current time over here.....???


Solution

  • If you want the current time, just:

    dateval += DateTime.Now.TimeOfDay;
    

    It's slightly odd to pick a different date but keep the current time though...