Loading ...
Sorry, an error occurred while loading the content.

Timer For -- Ville (was: RE:Outline...)

Expand Messages
  • wheeler54321
    ... (or clip) for ... eg. ... Hi! All the credits go to Eb Guenther - the original thread: http://groups.yahoo.com/group/ntb-clips/message/6068 Watch out for
    Message 1 of 5 , Apr 4, 2002
    • 0 Attachment
      > Now before I try this myself, does anyone know if there's a command
      (or clip) for
      > substracting times (/dates) to count the duration of some event,
      eg.
      > "14:45 minus 10:30 equals to 4:15 (or to 4.25)"?
      >
      > -Ville

      Hi!

      All the credits go to Eb Guenther - the original thread:
      http://groups.yahoo.com/group/ntb-clips/message/6068

      Watch out for long lines

      ;_____________________________________
      ^!SetListDelimiter ":"
      ^!SetArray %ST%=^?{Starting Time (hh:nn:ss)};%ET%=^?{Ending Time
      (hh:nn:ss)}

      ;____________ convert to seconds
      ^!Set %Ssec%=^$Calc(^%ST3% + ^%ST2% * 60 + ^%ST1% * 3600)$
      ^!Set %Esec%=^$Calc(^%ET3% + ^%ET2% * 60 + ^%ET1% * 3600)$
      ;____________ midnight correction
      ^!If ^%Ssec%>^%Esec% ^!Inc %Esec% 86400
      ;____________ elapsed time in seconds
      ^!Set %secs%=^$Calc(^%Esec%-^%Ssec%)$
      ;____________ convert to hh:mm:ss, left zero fill
      ^!Set %hrs%=^$StrCopyRight("0^$Calc( ^%secs% DIV 3600)$";2)$
      ^!Set %min%=^$StrCopyRight("0^$Calc((^%secs%-3600*^%secs%DIV3600)
      div60)$";2)$
      ^!Set %sec%=^$StrCopyRight("0^$Calc( ^%secs% MOD 60)$";2)$

      ^!Info [L]End %Start Time:^t^%ST%^%NL%^%NL%End Time:^%NL%^%ET%^%NL%^%
      NL%Elapsed Time:^%NL%^%hrs%:^%min%:^%sec%


      _______
      wheeler
    Your message has been successfully submitted and would be delivered to recipients shortly.