C examples for time.h:ctime
function
<ctime> <time.h>
Convert time_t value to string
char* ctime (const time_t * timer);
Parameter | Description |
---|---|
timer | a time value in type time_t. |
date and time information in a human-readable format.
#include <stdio.h> #include <time.h> int main ()/*from w ww . j ava 2s . co m*/ { time_t rawtime; time (&rawtime); printf ("The current local time is: %s", ctime (&rawtime)); return 0; }