如何将时间跨度转换为双值 [英] How can convert timespan to double value

查看:81
本文介绍了如何将时间跨度转换为双值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助.我需要将时间跨度值转换为双精度值的持续时间.有可能吗?

例如将00:01:20.434设为其双精度值(例如135.34等).

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..

推荐答案

您在问有关时间的很多问题.难道你是博士吗? :)

如果查看TimeSpan.TotalSeconds属性,您将看到它返回一个double值.就像所有"TotalWhatever"属性(TotalDays,TotalHours等)一样
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.)


,您可以从Timespan对象获取总秒数,毫秒,....那应该可以满足您的需求.
you can get the total seconds, milliseconds, ... from the Timespan object. That should give you what you need.


这篇关于如何将时间跨度转换为双值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆