From a7a5c98e296763c541daac2e6175ead8ede34c64 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 11 Jan 2005 03:07:53 +0000 Subject: r4669: a timeval_to_nttime() function as requested by abartlet. Andrew, its your responsibility to use/test this :-) (This used to be commit 2107b0cd7661a631952742bae241cb165b05c5f2) --- source4/lib/time.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source4/lib/time.c') 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; +} -- cgit