HELPLIB.HLB  —  TimeDiff
   Returns the time difference between a given start and end time.
   The end time must be the same as or later than the start time.

   In newer versions of OpenVMS the lexical function F$DELTA_TIME
   does the same.

   TimeDiff can be used on any OpenVMS version and will return the
   time difference not only in OpenVMS format, but optionaly in
   seconds, milliseconds or minutes.

   Timediff will always create the following four symbols:

     TIMEDIFF$START   Start time given to timediff
     TIMEDIFF$END     End time given to timediff
     TIMEDIFF$FORMAT  Format used for output value
     TIMEDIFF$VALUE   Output value

1    /START

   /START=<start time>

   Absolute time expression of the start time in the following
   format:

     dd-mmm-yyyy hh:mm:ss.cc

2    /END

   /END=<end time>

   Absolute time expression of the end time in the following
   format:

     dd-mmm-yyyy hh:mm:ss.cc

3    /FORMAT

   /FORMAT=<Output format>
   /FORMAT=DELTATIME (default)

   TimeDiff will return the time difference in the followinf formats:

   /FORMAT=DELTATIME
   /FORMAT=SECONDS
   /FORMAT=MILLISECONDS

4    /OUTPUT

   /OUTPUT=<symbol to receive the time difference>

   TimeDiff needs a symbol to return the time difference to DCL.

5  –  Examples

   $ TIMEDIFF /START="11-JAN-2007 11:00"/END="11-JAN-2007 11:15" -
              /OUTPUT=test
   $ SHOW SYMBOL test
     TEST = "   0 00:15:00.00"

   $ TIMEDIFF /START="11-JAN-2007 11:00"/END="11-JAN-2007 11:15" -
              /OUTPUT=test/FORMAT=SECONDS
   $ SHOW SYMBOL test
     TEST = "900"

   $ TIMDIFF /START=17-APR-2012 12:00/END=20-APR-2012 13:30 -
             /FORMAT=MINUTES
   $ SHOW SYMBOL timediff*
     TIMEDIFF$END = "20-APR-2012 13:30"
     TIMEDIFF$FORMAT = "MILLISECONDS"
     TIMEDIFF$START = "17-APR-2012 12:00"
     TIMEDIFF$VALUE = "26460000"
Close Help