summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/time.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source4/lib/time.c b/source4/lib/time.c
index 504b5d6ac3..92eb2dee5e 100644
--- a/source4/lib/time.c
+++ b/source4/lib/time.c
@@ -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;
+}