Asctime (the time and date are represented in string format)
Related functions
Time,ctime,gmtime,localtime
Table header File
#include
Defining function .h>
char * asctime (const struct TM * timeptr);
Function description
Asctime () Turns the information in the TM structure referred to by the parameter timeptr
Change the time-date representation method used by the real-world, and then the result in Word
The character string form returns. This function has been converted from time zone to local time, string
The format is:
"Wed June 21:49:08 1993\n"
return value
Returns a string representing the current local time date.
Additional Instructions
If the associated time-date function is called again, the string may be corrupted. This function differs from CTime in that the parameters passed in are different structures.
Example
#include <time.h>main () {time_t timep;time (&TIMEP);p rintf ("%s", Asctime (Gmtime (&TIMEP)));}
Executive Sat Oct 28 02:10:06 2000
CTime (the time and date are represented in string format)
Related functions
Time,asctime,gmtime,localtime
Table header File
#include
Defining function .h>
Char *ctime (const time_t *TIMEP);
Function description
CTime () Turns the information in the time_t structure referred to by the parameter TIMEP
Change the time-date representation method used by the real-world, and then the result in Word
The character string form returns. This function has been converted from time zone to local time, string
The format is "Wed June 21:49:08 1993\n". If you call the relevant
Time-Date function, this string may be corrupted.
return value
Returns a string representing the current local time date.
Example
#include <time.h>main () {time_t timep;time (&TIMEP);p rintf ("%s", CTime (&TIMEP));}
Executive Sat Oct 28 10:12:05 2000
This article is from the "canvas shoes can walk the cat step" blog, please be sure to keep this source http://9409270.blog.51cto.com/9399270/1863784
Using system time in Linux C