diff --git generic/tclClock.c generic/tclClock.c
index 194cfb3676..ecf5913221 100644
--- generic/tclClock.c
+++ generic/tclClock.c
@@ -1714,7 +1714,7 @@ ThreadSafeLocalTime(
 
     struct tm *tmPtr = (struct tm *)Tcl_GetThreadData(&tmKey, sizeof(struct tm));
 #ifdef HAVE_LOCALTIME_R
-    localtime_r(timePtr, tmPtr);
+    tmPtr = localtime_r(timePtr, tmPtr);
 #else
     struct tm *sysTmPtr;
 
