#include <time.h> #include <stdio.h> #include <dos.h> int main(void) { time_t timer; struct tm *tblock; /* gets time of day */ timer = time(NULL); /* converts date/time to a structure */ tblock = localtime(&timer); printf("Local time is: %s", asctime(tblock)); return 0; }