www.icetips.com  Icetips Utilities Documentation 11/30/2010    

Utility Class: GetClockValue

Previous  Top  Next  


Prototype:  (Long pClock, Byte pIntervalMin, Byte pRoundUp),Long

 

pClockTime value.

 

pIntervalMinInterval in minutes.

 

pRoundUpRounds up if True or down if false.

 

ReturnTime value after rounding up or down to the given interval.

 

This function takes a clock value and rounds it up or down to the nearest clock indicated in the pIntervalMin.  This is very useful for schedule type of calculation where an appointment should be scheduled for example with 15 minute intervals starting at the hour, i.e. at 18:00, 18:15, 18:30 and 18:45.  This function makes it very easy to do that.  Simply give it the time, interval in minutes and if it should round up or down and it will return the correct time value.

 

Example:

 

C1   Long

C2   Long

I    Byte

R    Byte

ITU  ITUtilityClass

Code

C1 = ITU.GetClockFromString('18:16:00')

I = 15 ! 15 minute interval

R = True

C1 = ITU.GetClockValue(C1,I,R)

I = 15 ! 15 minute interval

R = False

C2 = ITU.GetClockValue(C1,I,R)

 

C1 would be equal to 18:30:00 but C2 would be equal to 18:15:00

 

See also:

GetClockFromString

 

 

 



Direct link to this page: http://www.icetips.com/manuals/utilities/getclockvalue_utility.htm