Contact: aviboots(AT)netvision.net.il
40,760 questions
53,134 answers
573 users
#include <stdio.h> #include <time.h> int main(void) { struct timespec ts; timespec_get(&ts, TIME_UTC); printf("Time since epoch: %ld seconds", ts.tv_sec); } /* run: Time since epoch: 1676041889 seconds */
#include <stdio.h> #include <time.h> int main(void) { time_t seconds; seconds = time(NULL); printf("Time since epoch: %ld seconds", seconds); } /* run: Time since epoch: 1676042147 seconds */