asctime

Converts a broken-down time (see the localtime function for more information) into a 26-character string in the following form:

Sun Sep 16 01:03:52 1984\n\0

All fields have a constant width.

This function is nonreentrant.

Format

#include  <time.h>

char *asctime  (const struct tm *timeptr);

Argument

timeptr
A pointer to a structure of type tm, which contains the broken- down time.

Description

See the <time.h> header file for a description of the tm structure.

The asctime function converts the contents of tm into a 26-character string, as shown in the previous example, and returns a pointer to the string. Subsequent calls to asctime or ctime may point to the same static string, which is overwritten by each call.

See the localtime function in this section for a list of the members in tm.

Return Value
A pointer to the string. 


Previous Page | Next Page | Table of Contents | Index