TimeCls

A basic class to hold and manipulate time values

This section, including the code, was contributed by Adam King .
Environment: C++

 

Download now: TIMECLS.ZIP (16.7 k)

 

This class gives you the ability to hold & manipulate time values. It was developed to assist mainly in calculations for timing purposes and the display of durations. Also includes additional helper functions.

TimeCls makes it simple to perform addition and subtraction of time values, such as:

 

6:41:13 + 12:35:51 = 19:07:04

 

(where the time is in the format HH:MM:SS).

TIME a(6, 41, 13);
TIME b(12, 35, 51);

TIME c = a + b;

// Set time a to 6:41:13
// Set time b to 12:35:51

// Time c will contain 19:07:04
// after the addition

You can also retrieve the time value from the class in a number of useful ways (see the source file for comments).

Download now: TIMECLS.ZIP (16.7 k)

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.