#include <stdio.h> #include <time.h> int main () { time_t rawtime; struct tm *tminfo; time ( &rawtime ); tminfo = localtime ( &rawtime ); printf ( "Current date and time are: %s", asctime (tminfo) ); return 0; }