Procházet zdrojové kódy

* Added a useful tool

svn: 166
Bryan Drewery před 22 roky
rodič
revize
763fca0e53
1 změnil soubory, kde provedl 14 přidání a 0 odebrání
  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;
+}