diff --git a/src/selcommands.cpp b/src/selcommands.cpp
index 9d5afe5..684c027 100644
--- a/src/selcommands.cpp
+++ b/src/selcommands.cpp
@@ -1393,18 +1393,6 @@
             }
         }
 
-        time_t timeStamp = static_cast<time_t>(data->timeStamp);
-        std::string timeStr;
-        std::tm ts;
-        if (localtime_r(&timeStamp, &ts))
-        {
-            char buf[64];
-            if (strftime(buf, sizeof(buf), "%c", &ts))
-            {
-                timeStr = buf;
-            }
-        }
-
         parseStdSel(data, errLog);
         ptr = &(data->eventData1);
         std::vector<uint8_t> evtData(ptr, ptr + 3);
@@ -1416,9 +1404,8 @@
                      << std::setw(2) << (int)(data->sensorNum);
 
         msgLog += errType + " (0x" + recTypeStream.str() +
-                  "), Time: " + timeStr + ", Sensor: " + sensorName + " (0x" +
-                  senNumStream.str() + "), Event Data: (" + eventData + ") " +
-                  errLog;
+                  "), Sensor: " + sensorName + " (0x" + senNumStream.str() +
+                  "), Event Data: (" + eventData + ") " + errLog;
     }
     else if ((recType >= oemTSErrTypeMin) && (recType <= oemTSErrTypeMax))
     {
@@ -1434,24 +1421,11 @@
         std::string oemDataStr;
         toHexStr(oemData, oemDataStr);
 
-        time_t timeStamp = static_cast<time_t>(data->timeStamp);
-        std::string timeStr;
-        std::tm ts;
-        if (localtime_r(&timeStamp, &ts))
-        {
-            char buf[64];
-            if (strftime(buf, sizeof(buf), "%c", &ts))
-            {
-                timeStr = buf;
-            }
-        }
-
         errType = oemTSErr;
         parseOemSel(data, errLog);
 
-        msgLog += errType + " (0x" + recTypeStream.str() +
-                  "), Time: " + timeStr + ", MFG ID: " + mfrIdStr +
-                  ", OEM Data: (" + oemDataStr + ") " + errLog;
+        msgLog += errType + " (0x" + recTypeStream.str() + "), MFG ID: " +
+                  mfrIdStr + ", OEM Data: (" + oemDataStr + ") " + errLog;
     }
     else if (recType == fbUniErrType)
     {
