   [.net] DateTime, Subtract and strings
  I have a little problem:I have a string which contains a formatted time (example: string time = "12.45";)I want to subtract to the current time (DateTime.Now) the time in the string... and I don't know how to do that. I think I should use the Subtract function  but I don't know how to pass the time variable to DateTime.Now.Subtract()... Should I convert it to an Integer?   
  Well DateTime.Subtract takes either a DateTime or a Timespan.  You need the DateTime version which means you must convert your time string to a DateTime object.Use the DateTime.ParseExact method.  If you google DateTimeFormatInfo you can find the MSDN documentation that explains all of the various codes for your custom format string.  For example, assuming 12.45 means 12:45pm on a 24 hour clock, you would call the method like this:DateTime myDate = DateTime.ParseExact("12.45", "HH.mm", null);Make sense?  Good luck.   