日期减法为什么我在 Rebol / Red 中得不到 hh:mm:ss?
Date substraction why don't I get hh:mm:ss in Rebol / Red?
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
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