Advertisement
Guest User

Untitled

a guest
Nov 27th, 2015
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int _tmain(int argc, _TCHAR* argv[])
  2. {
  3.     FILE *f;
  4.     time_t rawtime;
  5.     struct tm * timeinfo;
  6.  
  7.    
  8.    
  9.     while (TRUE){
  10.         f = fopen("TestFile.txt", "a");
  11.         time(&rawtime);
  12.         timeinfo = localtime(&rawtime);
  13.         fprintf(f, "Current local time and date: %s", asctime(timeinfo));
  14.         printf("Current local time and date: %s", asctime(timeinfo));
  15.         fclose(f);
  16.         Sleep(1000);
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement