3

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

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

6

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

user310291
  • 36,946
  • 82
  • 271
  • 487

1 Answers1

4

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

Use difference function for that:

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

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

The same way as for any other date value:

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

Alternatively, you can use pick to avoid setting the intermediary date to a word:

>> 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
DocKimbel
  • 3,127
  • 16
  • 27