diff -urN diffutils-3.8-orig/configure diffutils-3.8/configure
--- diffutils-3.8-orig/configure	2021-08-02 10:56:20 +0900
+++ diffutils-3.8/configure	2021-08-06 11:20:40 +0900
@@ -1949,6 +1949,7 @@
 ac_user_opts='
 enable_option_checking
 enable_silent_rules
+enable_nanosecond_timestamps
 enable_dependency_tracking
 enable_largefile
 enable_year2038
@@ -2605,6 +2606,8 @@
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --enable-silent-rules   less verbose build output (undo: "make V=1")
   --disable-silent-rules  verbose build output (undo: "make V=0")
+  --disable-nanosecond-timestamps
+                          disable nanosecond resolution in timestamps
   --enable-dependency-tracking
                           do not reject slow dependency extractors
   --disable-dependency-tracking
@@ -4891,6 +4894,23 @@
 ac_config_headers="$ac_config_headers lib/config.h:lib/config.hin"
 
 
+# Check whether --enable-nanosecond-timestamps was given.
+if test "${enable_nanosecond_timestamps+set}" = set; then :
+  enableval=$enable_nanosecond_timestamps; case $enableval in
+                 yes|no) ;;
+                 *)      as_fn_error $? "bad value $enableval for nanosecond-timestamps option" "$LINENO" 5 ;;
+               esac
+               nsec_timestamps=$enableval
+else
+  nsec_timestamps=yes
+fi
+
+if ! test "no" = "$nsec_timestamps"; then
+
+$as_echo "#define NSEC_TIMESTAMPS 1" >>confdefs.h
+
+fi
+
 for ac_prog in gawk mawk nawk awk
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
diff -urN diffutils-3.8-orig/configure.ac diffutils-3.8/configure.ac
--- diffutils-3.8-orig/configure.ac	2021-04-03 08:04:18 +0900
+++ diffutils-3.8/configure.ac	2021-08-06 11:18:53 +0900
@@ -32,6 +32,20 @@
 
 AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
 
+AC_ARG_ENABLE(nanosecond-timestamps,
+              [AS_HELP_STRING([--disable-nanosecond-timestamps],
+                              [disable nanosecond resolution in timestamps])],
+              [case $enableval in
+                 yes|no) ;;
+                 *)      AC_MSG_ERROR([bad value $enableval for nanosecond-timestamps option]) ;;
+               esac
+               nsec_timestamps=$enableval],
+              [nsec_timestamps=yes])
+if ! test "no" = "$nsec_timestamps"; then
+  AC_DEFINE([NSEC_TIMESTAMPS], [1],
+            [Define to 1 to enable nanosecond resolution in timestamps.])
+fi
+
 AC_PROG_AWK
 AC_PROG_CC
 AM_PROG_CC_C_O
diff -urN diffutils-3.8-orig/lib/config.hin diffutils-3.8/lib/config.hin
--- diffutils-3.8-orig/lib/config.hin	2021-08-02 10:20:11 +0900
+++ diffutils-3.8/lib/config.hin	2021-08-06 11:20:41 +0900
@@ -1468,6 +1468,9 @@
 /* Define to 1 if nl_langinfo is multithread-safe. */
 #undef NL_LANGINFO_MTSAFE
 
+/* Define to 1 to enable nanosecond resolution in timestamps. */
+#undef NSEC_TIMESTAMPS
+
 /* Define to 1 if open() fails to recognize a trailing slash. */
 #undef OPEN_TRAILING_SLASH_BUG
 
diff -urN diffutils-3.8-orig/src/context.c diffutils-3.8/src/context.c
--- diffutils-3.8-orig/src/context.c	2021-01-02 10:37:49 +0900
+++ diffutils-3.8/src/context.c	2021-08-06 11:23:23 +0900
@@ -59,17 +59,29 @@
               && TYPE_MAXIMUM (time_t) <= LONG_MAX)
             {
               long int sec = inf->stat.st_mtime;
+#ifdef NSEC_TIMESTAMPS
               sprintf (buf, "%ld.%.9d", sec, nsec);
+#else
+              sprintf (buf, "%ld", sec);
+#endif
             }
           else if (TYPE_MAXIMUM (time_t) <= INTMAX_MAX)
             {
               intmax_t sec = inf->stat.st_mtime;
+#ifdef NSEC_TIMESTAMPS
               sprintf (buf, "%"PRIdMAX".%.9d", sec, nsec);
+#else
+              sprintf (buf, "%"PRIdMAX, sec);
+#endif
             }
           else
             {
               uintmax_t sec = inf->stat.st_mtime;
+#ifdef NSEC_TIMESTAMPS
               sprintf (buf, "%"PRIuMAX".%.9d", sec, nsec);
+#else
+              sprintf (buf, "%"PRIuMAX, sec);
+#endif
             }
         }
       fprintf (outfile, "%s %s\t%s", mark, name, buf);
diff -urN diffutils-3.8-orig/src/diff.c diffutils-3.8/src/diff.c
--- diffutils-3.8-orig/src/diff.c	2021-06-12 14:50:55 +0900
+++ diffutils-3.8/src/diff.c	2021-08-06 11:22:32 +0900
@@ -681,7 +681,8 @@
 
   if (output_style != OUTPUT_CONTEXT || hard_locale (LC_TIME))
     {
-#if (defined STAT_TIMESPEC || defined STAT_TIMESPEC_NS \
+#if defined NSEC_TIMESTAMPS && \
+    (defined STAT_TIMESPEC || defined STAT_TIMESPEC_NS \
      || defined HAVE_STRUCT_STAT_ST_SPARE1)
       time_format = "%Y-%m-%d %H:%M:%S.%N %z";
 #else
