[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


asctime

Convert a tm structure to a character array.

Compatibility:

This function is compatible with the following targets:

ANSI

BeOS

EMB/RTOS

Mac OS

Palm OS

Win32


Prototype:
#include <time.h>
char *asctime(const struct tm *timeptr);
Parameters:

Parameters for this facility are:

timeptr  
const struct tm *  
A pointer to a tm structure that holds the time information  

Remarks:

The asctime() function converts a tm structure, pointed to by timeptr, to a character array. The asctime() and ctime() functions use the same calendar time format. This format, expressed as a strftime() format string is "%a %b %e %H:%M: %S %Y". For example: Tue Apr 4 15:17:23 2000.

Return:

asctime() returns a null terminated character array pointer containing the converted tm structure.

See Also:

"ctime"

"strftime"

Example of asctime() usage.:
#include <time.h>
#include <stdio.h>

int main(void)
{
	time_t systime;
	struct tm *currtime;

	systime = time(NULL);
	currtime = localtime(&systime);

	puts(asctime(currtime));

	return 0;
}

Output:
Tue Nov 30 12:56:05 1993


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 16, 2000