time_frsec()

Converts the elapsed number of seconds to a time string

Call
#include <vv_sys.h>
int time_frsec(time_stp, seconds, format_stp)

UCHAR *time_stp

Destination string to contain the time string

long seconds Number of elapsed seconds
UCHAR *format_stp Pointer to format string
format_stp: Specify SYSTIMEFMT or a time format string of your own creation. A time format string is composed of the following characters:
H Represents hours. There can be from 2 to 6 Hs in the string.
M Represents minutes. There can only be 2 Ms in the string.
S Represents seconds. There can only be 2 Ss in the string.
am Indicates that a 12-hour clock should be used and "am" will be appended for times less than noon and "pm" will be appended for times after noon.
Any other characters may be used as separators between the components. The separators are optional. The maximum number of separators is 2 for the 24- hour clock and 3 for the 12-hour clock. If present, the separators will be copied into the destination time string.
Returns
1 The elapsed number of seconds was successfully converted to a formatted time string.
0 An invalid time was specified
Description

time_frsec() converts the number of elapsed seconds to a formatted time string. The elapsed seconds are broken into hours, minutes, and seconds. Then time_frnums() is called to create the time string using the specified format.

Related Functions

time_diff(), time_frnums(), time_get(), time_tonums(), time_tosec()

Cautions

The destination string must be large enough to hold the formatted time string, including the null terminator '/0'.

An invalid time (0 return) is not considered a fatal error. VV_ERR is not set; therefore, the VCS error reporting system does not report this condition.


Home Contents Previous Next