Rounding TIME! to a number of days in Rebol

87 Views Asked by At

I've found one way to turn a TIME! in Rebol into a number of days: add it to a date and then subtract that same date.

>> dummy-date: 12-Dec-2012
== 12-Dec-2012

>> (dummy-date + 44835:11:58) - dummy-date
== 1868

That's...rather awkward. Is there a better way built-in?

3

There are 3 best solutions below

1
sqlab On BEST ANSWER
>> pick 44835:11:58 / 24 1
== 1868

or short

first  44835:11:58 / 24
0
rgchris On

Another option would be:

>> round/to 44835:11:58 / 24:00 1
== 1868
0
iArnold On
time: 44835:11:58
round time/1 / 24
round first time / 24