gpt4 book ai didi

c# - 如何将十进制数转换为时间,反之亦然

转载 作者:太空狗 更新时间:2023-10-29 20:53:45 25 4
gpt4 key购买 nike

举个例子

            if 8.30 is there it should be 8 hours 30 minute
if 8 hour 20 minutes then 8.20

Please tell whether it is possible ? if yes
how ?

最佳答案

当人们谈论小数小时时,通常指的是 0.1 = 6 分钟。

因此,转换 8.3 的正确公式是:

8 小时 + 3 * 6 分钟 = 8:18

要将 8:20 转换为十进制,则为:

8 + 20/6 = 8.333333(可能四舍五入为 8.3)

关于c# - 如何将十进制数转换为时间,反之亦然,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1345599/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com