Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Time Function

From: kevin:sunshinecable at: 11-Dec-2000 11:47

On Tue, 12 Dec 2000, Aden Burnie wrote:
> Im trying to write a function that calculates time elapsed (eg > compare 12/12/2000,6:30:00 to 17/01/2001,12:00:00) , ive done the basic > conversion of date/time to hours/minutes/seconds elapsed, but i cant > figure out how to turn say "777:45:03" back into weeks / days / hours / > minutes / seconds elapsed.
How about something like this: a: to-time "777:45:03" weeks: to-integer a/hour / (24 * 7) a: a/hour: a/hour - (weeks * 24 * 7) days: to-integer a/hour / 24 a: a/hour: a/hour - (days * 24) print rejoin ["Time elapsed: " weeks " weeks, " days " days, " a] Regards, Kev