Explorar o código

* Added a useful tool

svn: 166
Bryan Drewery %!s(int64=22) %!d(string=hai) anos
pai
achega
763fca0e53
Modificáronse 1 ficheiros con 14 adicións e 0 borrados
  1. 14 0
      misc/utc-time.c

+ 14 - 0
misc/utc-time.c

@@ -0,0 +1,14 @@
+/* This file simply returns number of seconds since epoch in UTC 
+ */
+
+#include <time.h>
+#include <stdio.h>
+#include <string.h>
+
+int main() {
+  time_t now, nowtm;
+  now = time(NULL);
+  nowtm = mktime(gmtime(&now));
+  printf("%lu\n", nowtm);
+  return 0;
+}