Click here to Skip to main content
15,903,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please help. I need to convert a timespan value to its duration in double values. Is it possible?

for e.g 00:01:20.434 to its double value like 135.34 etc..
Posted
Updated 9-Jun-10 1:09am
v3

You are asking a lot of questions about time. Are you, by any chance Dr Who? :)

If you look at the TimeSpan.TotalSeconds property, you will see that it returns a double value. As do all of the 'TotalWhatever' properties (TotalDays, TotalHours etc.)
 
Share this answer
 
Comments
Lokesh Zende 26-Jul-18 3:06am    
I have a time parameter whose value is like "14:07:58". How can I convert it to double?
you can get the total seconds, milliseconds, ... from the Timespan object. That should give you what you need.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900