Formats a user-supplied date and timechar *sm_udtime(struct tm *dt_tm_data, char *format);
- A pointer to the date and time data to format.
tmstructure, defined in the standard C header file
- Specifies the format to use with an expression that starts with
n, followed by any combination of date/time tokens and literal text.
yindicates a 12-hour clock;
nor any other character indicates a 24-hour clock. This character is required even if the format does not include time tokens. Refer to Table 5-19 for a list of the date/time tokens that you use to build a format expression.
sm_udtimeformats the date and time data in
dt_tm_dataaccording to the specified
This function uses a static buffer that it shares with other date and time formatting functions. The buffer is 256 bytes long. Panther does not check for overflow. Consequently, you should process the returned string or copy it to a local variable before making additional function calls.
/* Put the date 135 days from now into the field "maturity" */
struct tm *matdate;
/* calculate local time in seconds */
tim = time((time_t *)0) + 135L * 24 * 60 * 60;
matdate = localtime(&tim);
ptr = sm_udtime(matdate, " %0f");