Sun Java System Web Server 7.0 Update 4 NSAPI Developer's Guide

util_strftime() Function

The util_strftime function translates a tm structure, which is a structure describing a system time, into a textual representation. util_strftime is a thread-safe version of the standard strftime function.

Syntax

int util_strftime(char *s, const char *format, const struct tm *t);

Return Values

The number of characters placed into s, not counting the terminating NULL character.

Parameters

char *s is the string buffer to put the text into. This function does not perform bounds checking, so you must make sure that the buffer is large enough for the text of the date.

const char *format is a format string, similar to printf string in that it consists of text with certain %x substrings. You can use the constant HTTP_DATE_FMT to create date strings in the standard Internet format. For more information, see the documentation on the printf function for the runtime library of your compiler. For more information on time formats, see the Sun Java System Web Server 7.0 Update 4 Administrator’s Configuration File Reference.

const struct tm *t is a pointer to a calendar time (tm) structure, usually created by the function system_localtime or system_gmtime.

See Also

system_localtime() Function, system_gmtime() Function