Rounding TIME! to a number of days in Rebol

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?

Upvotes: 1

Views: 94

Answers (3)

iArnold
iArnold

Reputation: 333

time: 44835:11:58
round time/1 / 24
round first time / 24

Upvotes: 1

sqlab
sqlab

Reputation: 6436

>> pick 44835:11:58 / 24 1
== 1868

or short

first  44835:11:58 / 24

Upvotes: 1

rgchris
rgchris

Reputation: 3718

Another option would be:

>> round/to 44835:11:58 / 24:00 1
== 1868

Upvotes: 2

Related Questions