Thursday, July 21, 2011

To print system time


/* localtime example */
#include
#include

int main ()
{
  time_t rawtime;
  struct tm * timeinfo;

  time ( &rawtime );
  timeinfo = localtime ( &rawtime );
  printf ( "Current local time and date: %s", asctime (timeinfo) );
 
  return 0;
}

No comments:

Post a Comment