r4669: a timeval_to_nttime() function as requested by abartlet. Andrew, its
authorAndrew Tridgell <tridge@samba.org>
Tue, 11 Jan 2005 03:07:53 +0000 (03:07 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:08:40 +0000 (13:08 -0500)
your responsibility to use/test this :-)
(This used to be commit 2107b0cd7661a631952742bae241cb165b05c5f2)

source4/lib/time.c

index 504b5d6ac3194c3d3be17cc71c2c0b0bf16a2015..92eb2dee5e1746d6b0d294124bba0454fe524516 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)
+{
+       double t1 = tv->tv_sec + (tv->tv_usec*1.0e-6);
+       return (t1 + TIME_FIXUP_CONSTANT) * 1.0e7;
+}