This is going to sound very silly but I can't get a string to convert into a DateTime that carries the date and time
I try this :
Response.Write(year + " " + month + " " + day + " " + hour + " " + min );
//prints 2008 9 23 11 59 0 (represents 9/23/2008 11:59 00 AM)
DateTime dt= new DateTime(year , month , day , hour , min , 00);
But it tells me it is not a representable DateTime. Same thing here.
String toParse = "9/23/2008" + " " + hour + ":" + minute + " 00 " + "AM" ;
DateTime dt= Convert.ToDateTime(toParse);
I'm having so much trouble. How do I do this correctly?