[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 TIMETOSEC()
 Calculates the seconds since midnight
------------------------------------------------------------------------------
 Syntax

     TIMETOSEC(<cTime>) --> nSeconds

 Argument

     <cTime>  Designates a character string that contains the time in the
     format "HH:MM:SS:hh".  The default is the system time.

 Returns

     The returned value designates how many seconds have elapsed between
     midnight and <cTime>.  Hundredths of seconds are contained as a decimal
     value.

 Description

     When computing time periods, or when adding times, it is simpler to deal
     with seconds since midnight instead of time designations.  These
     calculations are simplified significantly.  The SECTOTIME() function
     converts the result into a time designation again.  Starting from back
     to front, you can omit the hundredths, seconds, and minutes from the
     time string that is passed as a parameter.  These values are then
     assumed to be "00".

     If you do not specify a parameter, the function uses the current time on
     the system clock.

 Examples

     .  A simple conversion:

        ? TIMETOSEC("12:44:33:22")                 // Result:  45873.22

     .  The period between two times is calculated. The result is
        displayed in seconds:

        cBegin      :=  "12:55:44:33"
        cEnd         :=  "14:56:12:22"
        ? TIMETOSEC(cEnd) - TIMETOSEC(cBegin)      // Period in seconds

     .  Possible formats:

        ? TIMETOSEC("12")
        ? TIMETOSEC("12:44)
        ? TIMETOSEC("12:44:33)
        ? TIMETOSEC("12:44:33:22")


See Also: SECTOTIME()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson