Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert TimeSpan to float

How do I convert a TimeSpan to a float , taking into account all of the processing unit (hour minute) for example if (unit = hour) convert TimeSpan to a float hours

In another context, is there not a data type "Timespan" in SQL Server ?

like image 389
Ks_Hamza Avatar asked Feb 14 '13 08:02

Ks_Hamza


1 Answers

Use the Total* properties on TimeSpan, e.g. TimeSpan.TotalHours.

like image 136
Daniel Hilgarth Avatar answered Sep 30 '22 10:09

Daniel Hilgarth