utc-time.c 255 B

1234567891011121314
  1. /* This file simply returns number of seconds since epoch in UTC
  2. */
  3. #include <time.h>
  4. #include <stdio.h>
  5. #include <string.h>
  6. int main() {
  7. time_t now, nowtm;
  8. now = time(NULL);
  9. nowtm = mktime(gmtime(&now));
  10. printf("%lu\n", nowtm);
  11. return 0;
  12. }