Guardian C Library Calls Reference Manual

Reference to Library Calls
Guardian TNS C Library Calls Reference Manual128833 3-3
asctime
asctime
The asctime function converts the broken-down time pointed to by timeptr into a string.
timeptr
points to the broken-down time.
Return Value
is a pointer to the string.
Usage Guidelines
The structure pointed to by timeptr is of type struct tm. The structure type struct tm
is defined in the header timeh and has the following members:
struct tm{
int tm_sec; /* seconds after the minute: [0, 61]*/
int tm_min; /* minutes after the hour: [0, 59] */
int tm_hour; /* hours since midnight: [0, 23] */
int tm_mday; /* day of the month: [1, 31] */
int tm_mon; /* months since January: [0, 11] */
int tm_year; /* years since 1900 */
int tm_wday; /* days since Sunday; [0, 6] */
int tm_yday; /* days since January 1: [0, 365] */
int tm_isdst; /* Daylight Savings Time flag */
};
Note that the flag tm_isdst is positive if Daylight Savings Time is in effect, zero if it
is not, and negative if the information is not available.
The string containing the time has 26 characters and has the form:
Sun Sep 16 01:03:52 1973\n\0
The new-line character (\n) and null character(\0) occupy the last two positions in
the string.
Later calls to asctime() and ctime() overwrite the string.
#include <timeh>
char *asctime (const struct tm *timeptr);