HP C/iX Library Reference Manual (30026-90004)

106 Chapter5
HP C/iX Library Function Descriptions
asctime
modify the date stored in tm before you print the data. If you only want to print the date,
use the time/ctime combination.
Of all the ctime functions, the localtime function is the most useful. The localtime
function enables you to break up the current time into chunks that can be easily
referenced and examined for such applications as personal calendar programs and
program schedulers. Many of the tm values can be used as indices into arrays containing
strings identifying months and days. For example, declaring an external array like
char *month[]={"January", "February", "March", "April",
"May", "June", "July", "August", "September",
"October", "November", "December"
};
enables you to use tm_mon as an index into this array to obtain the actual month name.
The same thing can be done with tm_wday if you initialize an array containing the names
of the days of the week.
See Also
clock(), mktime(), localtime(), time(), ANSI C 4.12.3.1, POSIX.1 8.1.1