Click to See Complete Forum and Search --> : Populating date variable


Broodmdh
September 19th, 2007, 02:52 PM
I have two variables, one of which contains a date and one of which contains a time, and both are of type Date. I need to be able to merge these together into a single variable of type Date, but I'm not sure how to do it. Any suggestions?

jasonli
September 25th, 2007, 03:42 PM
Just a piece of advice:
string strDate = "09/22/2007";//from date variable
string strTime = "12:13:22PM";//from time variable
DateTime dt = new DateTime();
DateTime.TryParse(strDate + " " + strTime, out dt);

Assuming you are using C#.