Link to home
Start Free TrialLog in
Avatar of amillyard
amillyardFlag for United Kingdom of Great Britain and Northern Ireland

asked on

how do I parse the following x3 variables to become: 01/01/2010 9:00 (datetime column)

how do I parse the following x3 variables to become:  01/01/2010 9:00   (datetime column)

radDateTimePickerAddNoteCallBack.Value   (contains for example:  01/01/2010 00:00:00)
radComboBoxAddNoteCallBackHour.Text   (contains for example: 9)
radComboBoxAddNoteCallBackMinutes.Text  (contains for example: 00)
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
"d" only exists inside of the "try", so you might want to move it out to use it elsewhere  :)
DateTime d;

try
{
    d = Convert.ToDateTime(radDateTimePickerAddNoteCallBack.Value);
    d = d.AddHours(Convert.ToInt32(radComboBoxAddNoteCallBackHour.Text));
    d = d.AddMinutes(Convert.ToInt32(radComboBoxAddNoteCallBackMinutes.Text));
}
catch
{

}

Open in new window

Avatar of amillyard

ASKER

kaufmed: spot on -- thank you :-)
NP. Glad to help :)