time.c
Upload User: bjtelijie
Upload Date: 2010-01-01
Package Size: 87k
Code Size: 0k
Category:

Algorithm

Development Platform:

Visual C++

  1. # include <time.h>
  2. # include <stdio.h>
  3. int main()
  4. {
  5. struct tm *local;
  6. time_t tm;
  7. tm = time(NULL);
  8. local = localtime(&tm);
  9. printf("Local time and date: %sn", asctime(local));
  10. local = gmtime(&tm);
  11. printf("UTC time and date: %sn", asctime(local));
  12. return 0;
  13. }