gettimeofday(&tv, NULL);
//time(&caltime);
TRACE("[AUDIT-TRACE] time of day sec %ld, usec %ld.\n", tv.tv_sec, tv.tv_usec);
//tmptr = gmtime(&caltime);
tmptr = localtime(&tv.tv_sec);
snprintf(timeval_buf, sizeof(timeval_buf), "%.4d%.2d%.2d%.2d%.2d%.2d%.6ld",
tmptr->tm_year + 1900,
tmptr->tm_mon + 1,
tmptr->tm_mday,
tmptr->tm_hour,
tmptr->tm_min,
tmptr->tm_sec,
tv.tv_usec);
//time(&caltime);
TRACE("[AUDIT-TRACE] time of day sec %ld, usec %ld.\n", tv.tv_sec, tv.tv_usec);
//tmptr = gmtime(&caltime);
tmptr = localtime(&tv.tv_sec);
snprintf(timeval_buf, sizeof(timeval_buf), "%.4d%.2d%.2d%.2d%.2d%.2d%.6ld",
tmptr->tm_year + 1900,
tmptr->tm_mon + 1,
tmptr->tm_mday,
tmptr->tm_hour,
tmptr->tm_min,
tmptr->tm_sec,
tv.tv_usec);