Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Linux by (18.4k points)
recategorized by

I would like to get a current timestamp and print it out using the fprintf

1 Answer

0 votes
by (36.8k points)
edited by

For the 32-bit systems:

fprintf(stdout, "%u\n", (unsigned)time(NULL)); 

For the 64-bit systems:

fprintf(stdout, "%lu\n", (unsigned long)time(NULL)); 

Want to be a Linux expert? Come and join this Linux course

Do check out the video below

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...