Mega Code Archive

 
Categories / C / Code Snippets
 

Returns a time in string, whose form is day month year

//Declaration: char *ctime(const time_t *time); #include <time.h> #include <stdio.h> int main(void) { time_t lt; lt = time(NULL); printf(ctime(&lt)); return 0; } /* Wed Jun 3 18:12:44 2012 */