如何将双精度值转换为秒? [英] how to convert a double value to seconds?

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

问题描述

Hii ..

如何将双精度值转换为秒?
因此,对我来说添加日期会更容易
date.AddSeconds(两倍持续时间)..
否则,仅将发送部分添加日期.

Hii..

How is it possible to convert a double value to seconds?
So it will easier for me to add it with a date
date.AddSeconds(double duration)..
Other wise only the send part will be added with the date .

推荐答案

chinnu20写道:
chinnu20 wrote:

如何将双精度值转换为秒?

How is it possible to convert a double value to seconds?



秒可以转换成分钟,小时,天,周,年等,反之亦然.
但是要几秒钟呢?

我想您对您的问题不太清楚.请解释.



Seconds can be converted to minute, hour, day, week, years etc and vice-versa.
But double to seconds?

I guess you are not very clear about your question. Please explain.


chinnu20写道:
chinnu20 wrote:

将双精度值转换为秒数


希望它意味着您拥有一些双重价值,需要将其转换为秒.

您需要从中提取整数,然后按如下所示使用它:


Hope it means you have some double value with it and you need to convert it into seconds.

You need to extract the integer out of it and then use it like:

int numberOfSecs = 35;
DateTime dt = new DateTime();
dt.Add(new TimeSpan(0,0,numberOfSecs);



不支持Double.
顺便说一句,从您写的那一行开始:



Double is not supported.
BTW from the line you wrote:

chinnu20写道:
chinnu20 wrote:

date.AddSeconds(两倍持续时间)..

date.AddSeconds(double duration)..



看来您可以使用整数.



It looks like you can use integer.


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

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