c# - how can i convert time span to a double value -


  timespan totaldays = endtime.subtract(starttime);   double tdays = convert.todouble(totaldays); 

i m getting here error as

unable cast object of type 'system.timespan' type 'system.iconvertible'. 

how can timespan value double type

just need use timespan.totaldays property

timespan totaldays = endtime.subtract(starttime); double tdays = totaldays.totaldays;