Getting the Current Time from the System

To get the time from the system, call the get time function time_get():

int time_get(time_stp, format_stp)
 
UCHAR *time_stp;
/* String to receive formatted time
*/
UCHAR *format_stp;
/* Time format string to use
*/

This function gets the time from the operating system and formats it according to the specified format string.

For instance, to get the time using the system time format, call:

UCHAR *time_stp;



time_stp = mem_get(9);

time_get(time_stp, SYSTIMEFMT);

Note that you must allocate memory for the string used to receive the formatted time string. This string must be long enough to accept a time string of the specified format.


Home Contents Previous Next