gpt4 book ai didi

rebol - 日期减法为什么我得不到hh :mm:ss in Rebol/Red?

转载 作者:行者123 更新时间:2023-12-01 12:16:52 24 4
gpt4 key购买 nike

1°) 我只得到天数,如何同时得到 hh:mm:ss ?

diff: (now - (10-Nov-2017/15:00:00))

6

2°) 获取分钟数最优雅的方法是什么?

最佳答案

1°) I get only the number of days, how to also get the hh:mm:ss ?

为此使用difference 函数:

>> difference now 10-Nov-2017/15:00:00
== 145:19:24

2°) What's the most elegant way to get the number of minutes ?

与任何其他日期值相同的方式:

>> d: difference now 10-Nov-2017/15:00:00
>> d/minute
== 21

或者,您可以使用 pick 来避免将中间日期设置为单词:

>> pick (difference now 10-Nov-2017/15:00:00) 2  ; Red and Rebol2/3
== 21
>> pick (difference now 10-Nov-2017/15:00:00) 'minute ; Rebol3, not yet implemented in Red
== 21

关于rebol - 日期减法为什么我得不到hh :mm:ss in Rebol/Red?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47334180/

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