datetimerebolrebol3rebol2

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?


Solution

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

    or short

    first  44835:11:58 / 24