#include <stdio.h> #include <time.h> int main() { time_t t; time(&t); printf("Current Date and Time is %s", ctime(&t)); return 0; }
kodingwindow@kw:~$ gcc kw.ckodingwindow@kw:~$ ./a.out Current Date and Time is Thu May 31 07:44:51 2018 kodingwindow@kw:~$