I would like to get the current timestamp and print it out using fprintf.
fprintf
For 32-bit systems:
fprintf(stdout, "%u\n", (unsigned)time(NULL));
For 64-bit systems:
fprintf(stdout, "%lu\n", (unsigned long)time(NULL));