$NetBSD: patch-ad,v 1.2 2008/08/20 03:04:20 bjs Exp $

--- date.c.orig	2008-08-17 16:43:06.000000000 -0400
+++ date.c
@@ -832,13 +832,19 @@ unsigned long approxidate(const char *da
 	int number = 0;
 	struct tm tm, now;
 	struct timeval tv;
+	struct timespec ts;
 	char buffer[50];
 
 	if (parse_date(date, buffer, sizeof(buffer)) > 0)
 		return strtoul(buffer, NULL, 10);
 
 	gettimeofday(&tv, NULL);
+#ifdef __NetBSD__
+	TIMEVAL_TO_TIMESPEC(&tv, &ts);
+	localtime_r(&ts.tv_sec, &tm);
+#else
 	localtime_r(&tv.tv_sec, &tm);
+#endif
 	now = tm;
 	for (;;) {
 		unsigned char c = *date;
