Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Library for Clipper - <b>time functions</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
                             TIME FUNCTIONS


   These simple functions have been provided to allow easy manipulation
   of time strings of the form "HH:MM:SS". The functions cover addition/
   subtraction of time strings, conversion of hours, minutes and seconds
   to each other and the checking for valid time strings etc.

   You may choose to accept time strings from a user using the following
   program segment.

            timestr = "  :  :  "
            @ 10,10 say "Enter time: "
            @ 10,22 get timestr picture "99:99:99"


   These time functions have numerous uses.  It may be desirable to use
   these functions to manipulate absolute time values where the time may
   not exceed "23:59:59".

   However, if for instance it is necessary to calculate relative times,
   for example, how long a project has taken or overtime calculations it
   must be possible to have a number of hours greater than 24.

   A valid time string under these circumstances is interpreted as one
   which has a length of at least 7 characters. i.e. "H:MM:SS" or
   "HHHHHH:MM:SS"

   When using those functions which return time strings, i.e. L_DYS2HMS()
   or L_HMS2HRS() a parameter may be passed to the function to indicate
   the desired format for the hours part of the string.

   In other words, it is possible to return strings of the form
   "HH:MM:SS" or "HHHHH:MM:SS" e.g. "12345:45:23"

   Time strings will have leading zeros if the specified format width
   (zone) is too wide for the number of characters representing the hours.

   All functions which return strings as a result return null, CHR(0), if
   an incorrect number of parameters were passed to the function or
   parameters of the wrong type were passed.

   All those others which return numerics will return -1 in the event of
   one of the above conditions.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson