#include <time.h>
#include <stdio.h>
int main(void)
{
time_t mytime;
mytime = time(NULL);
printf(ctime(&mytime));
return 0;
}
Www Mmm dd hh:mm:ss yyyy
Www = which day of the week.
Mmm = month in letters.
dd = the day of the month.
hh:mm:ss = the time in hour, minutes, seconds.
yyyy = the year.
Output example:
Tue Feb 26 09:01:47 2009




