I assume you want it in floating point format, e.g. xx.yy where yy = 0..60 right? So you get 10.02 which means 10:02.
The solution is easy:
DateTime starttime = Convert.ToDateTime(date1);
TimeSpan diff = Convert.ToDateTime(date2).Subtract(starttime);
double timedef = diff.Hours + diff.Minutes / 100.0;
Otherwise this will do
double timedef = diff.Hours + diff.Minutes / 60.0;
I imagine it can have some use if you do something like this:
var str = timedef.ToString("0.00");
... but there are better ways to do that. TimeSpan and DateTime do a lot of magic, if you don't really need a double
, stick with it until the very end.
A note about fixed point
DateTime uses integers to do its math. Double's use floating point. Floating point arithmetic by definition introduces errors; therefore it's probably better (and safer) to use integer arithmetics.
DateTime and Timespan provide exactly this for date and delta-time operations.