time support: For portability, also include <time.h>
diff --git a/configure b/configure
index 39c92e9..f54c09f 100755
--- a/configure
+++ b/configure
@@ -16280,6 +16280,20 @@
 done
 
 
+for ac_header in time.h
+do :
+  ac_fn_cxx_check_header_mongrel "$LINENO" "time.h" "ac_cv_header_time_h" "$ac_includes_default"
+if test "x$ac_cv_header_time_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_TIME_H 1
+_ACEOF
+ :
+else
+  as_fn_error $? "*** time.h not found. Check 'config.log' for more details." "$LINENO" 5
+fi
+
+done
+
 for ac_header in sys/time.h
 do :
   ac_fn_cxx_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default"
@@ -16674,7 +16688,8 @@
 $as_echo_n "checking for gmtime support... " >&6; }
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/time.h>
+#include <time.h>
+    #include <sys/time.h>
     struct timeval tv;
     int result1 = gettimeofday(&tv, 0);
     time_t time1 = time(0);
diff --git a/configure.ac b/configure.ac
index ebd0565..eba776b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,6 +59,7 @@
 AC_CHECK_FUNCS([memcmp] [memcpy] [memset])
 AC_CHECK_FUNCS([strchr], :, AC_MSG_ERROR([*** strchr not found. Check 'config.log' for more details.]))
 AC_CHECK_FUNCS([sscanf], :, AC_MSG_ERROR([*** sscanf not found. Check 'config.log' for more details.]))
+AC_CHECK_HEADERS([time.h], :, AC_MSG_ERROR([*** time.h not found. Check 'config.log' for more details.]))
 AC_CHECK_HEADERS([sys/time.h], :, AC_MSG_ERROR([*** sys/time.h not found. Check 'config.log' for more details.]))
 AC_CHECK_FUNCS([gettimeofday], :, AC_MSG_ERROR([*** gettimeofday not found. processEvents requires it. Check 'config.log' for more details.]))
 AX_CXX_COMPILE_STDCXX_11(, optional)
@@ -112,6 +113,7 @@
 
 AC_MSG_CHECKING([for gmtime support])
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+    [[#include <time.h>]]
     [[#include <sys/time.h>]]
     [[struct timeval tv;]]
     [[int result1 = gettimeofday(&tv, 0);]]
diff --git a/include/config.h.in b/include/config.h.in
index 7621126..2fe8965 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -78,6 +78,9 @@
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
+/* Define to 1 if you have the <time.h> header file. */
+#undef HAVE_TIME_H
+
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
diff --git a/ndn-cpp/c/util/time.c b/ndn-cpp/c/util/time.c
index b7de490..5a74466 100644
--- a/ndn-cpp/c/util/time.c
+++ b/ndn-cpp/c/util/time.c
@@ -4,6 +4,7 @@
  * See COPYING for copyright and distribution information.
  */
 
+#include <time.h>
 #include <sys/time.h>
 #include <math.h>
 #include <string.h>