r4670: abartlet was worried about floating point precision with my first
[gd/samba-autobuild/.git] / source4 / lib / time.c
index 504b5d6ac3194c3d3be17cc71c2c0b0bf16a2015..fd005215a118c363a59fbce34442c8a086fa3875 100644 (file)
@@ -536,3 +536,13 @@ struct timeval timeval_diff(struct timeval *tv1, struct timeval *tv2)
        }
        return t;
 }
+
+
+/*
+  convert a timeval to a NTTIME
+*/
+NTTIME timeval_to_nttime(struct timeval *tv)
+{
+       return 10*(tv->tv_usec + 
+                 ((TIME_FIXUP_CONSTANT + (uint64_t)tv->tv_sec) * 1000000));
+}