diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp
index b6c1481d324ce63e91894f5944178d16e2b27271..c4b0574abd9bba2fc7fcc29620687194b07261c9 100644
--- a/indra/newview/llfloaterimsessiontab.cpp
+++ b/indra/newview/llfloaterimsessiontab.cpp
@@ -433,7 +433,10 @@ std::string LLFloaterIMSessionTab::appendTime()
 	time_t utc_time = time_corrected();
 
 	static const std::string time_str = fmt::format(FMT_STRING("[{}]:[{}]"), LLTrans::getString("TimeHour"), LLTrans::getString("TimeMin"));
-	std::string timeStr = time_str;
+	static const std::string time_str_seconds = fmt::format(FMT_STRING("[{}]:[{}]:[{}]"), LLTrans::getString("TimeHour"), LLTrans::getString("TimeMin"), LLTrans::getString("TimeSec"));
+	static const LLCachedControl<bool> show_timestamp_seconds(gSavedSettings, "ChatTimestampSeconds", false);
+
+	std::string timeStr = show_timestamp_seconds ? time_str_seconds : time_str;
 
 	LLSD substitution;
 	substitution["datetime"] = (S32) utc_time;
diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp
index 949a2362ee2c8fdc51b3307d2d00daadf21975e4..dfb458e7d5e3edd87bc827b11956b41cbd8d1875 100644
--- a/indra/newview/lllogchat.cpp
+++ b/indra/newview/lllogchat.cpp
@@ -301,16 +301,20 @@ std::string LLLogChat::cleanFileName(std::string filename)
 
 std::string LLLogChat::timestamp2LogString(U32 timestamp, bool withdate)
 {
+	static const LLCachedControl<bool> show_timestamp_seconds(gSavedSettings, "ChatTimestampSeconds", false);
+
 	std::string timeStr;
 	if (withdate)
 	{
 		static const std::string timestamp_long_fmt = fmt::format(FMT_STRING("[{}]/[{}]/[{}] [{}]:[{}]"), LLTrans::getString("TimeYear"), LLTrans::getString("TimeMonth"), LLTrans::getString("TimeDay"), LLTrans::getString("TimeHour"), LLTrans::getString("TimeMin"));
-        timeStr = timestamp_long_fmt;
+		static const std::string timestamp_long_sec_fmt = fmt::format(FMT_STRING("[{}]/[{}]/[{}] [{}]:[{}]:[{}]"), LLTrans::getString("TimeYear"), LLTrans::getString("TimeMonth"), LLTrans::getString("TimeDay"), LLTrans::getString("TimeHour"), LLTrans::getString("TimeMin"), LLTrans::getString("TimeSec"));
+        timeStr = show_timestamp_seconds ? timestamp_long_sec_fmt : timestamp_long_fmt;
 	}
 	else
 	{
 		static const std::string timestamp_short_fmt = fmt::format(FMT_STRING("[{}]:[{}]"), LLTrans::getString("TimeHour"), LLTrans::getString("TimeMin"));
-        timeStr = timestamp_short_fmt;
+		static const std::string timestamp_short_sec_fmt = fmt::format(FMT_STRING("[{}]:[{}]:[{}]"), LLTrans::getString("TimeHour"), LLTrans::getString("TimeMin"), LLTrans::getString("TimeSec"));
+        timeStr = show_timestamp_seconds ? timestamp_short_sec_fmt : timestamp_short_fmt;
 	}
 
 	LLSD substitution;