#include <time.h>char *asctime(const struct tm *ptr);

The asctime( ) function returns a pointer to a string that contains the information stored in the structure pointed to by ptr converted into the following form:

day month date hours:minutes:seconds year\n\0

For example:

Fri Apr 15 12:05:34 2005

The structure pointed to by ptr is usually obtained from either localtime( ) or gmtime( ).

The buffer used by asctime( ) to hold the formatted output string is a statically allocated character array and is overwritten each time the function is called. If you want to save the contents of the string, you must copy it elsewhere.

Related functions are localtime( ), gmtime( ), time( ), and ctime( ).

C(s)C++ Programmer's Reference
C Programming on the IBM PC (C Programmers Reference Guide Series)
ISBN: 0673462897
EAN: 2147483647
Year: 2002
Pages: 539 © 2008-2017.
If you may any questions please contact us: