소스 검색

* Added a useful tool

svn: 166
Bryan Drewery 22 년 전
부모
커밋
763fca0e53
1개의 변경된 파일14개의 추가작업 그리고 0개의 파일을 삭제
  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;
+}