diff --git a/src/sbbs3/atcodes.cpp b/src/sbbs3/atcodes.cpp
index 738408863b8cfe4d0e6aa31efe09250b70393287..dc954760d548263b7c4b7b400fcd2135c1419619 100644
--- a/src/sbbs3/atcodes.cpp
+++ b/src/sbbs3/atcodes.cpp
@@ -228,8 +228,8 @@ const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen)
 		memset(&tm,0,sizeof(tm));
 		localtime_r(&now,&tm);
 		if(cfg.sys_misc&SM_MILITARY)
-			safe_snprintf(str,maxlen,"%02d:%02d"
-		        	,tm.tm_hour,tm.tm_min);
+			safe_snprintf(str,maxlen,"%02d:%02d:%02d"
+		        	,tm.tm_hour,tm.tm_min,tm.tm_sec);
 		else
 			safe_snprintf(str,maxlen,"%02d:%02d %s"
 				,tm.tm_hour==0 ? 12
@@ -453,10 +453,14 @@ const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen)
 	if(!strcmp(sp,"LASTTIMEON")) {
 		memset(&tm,0,sizeof(tm));
 		localtime32(&useron.laston,&tm);
-		safe_snprintf(str,maxlen,"%02d:%02d %s"
-			,tm.tm_hour==0 ? 12
-			: tm.tm_hour>12 ? tm.tm_hour-12
-			: tm.tm_hour, tm.tm_min, tm.tm_hour>11 ? "pm":"am");
+		if(cfg.sys_misc&SM_MILITARY)
+			safe_snprintf(str,maxlen,"%02d:%02d:%02d"
+				,tm.tm_hour, tm.tm_min, tm.tm_sec);
+		else
+			safe_snprintf(str,maxlen,"%02d:%02d %s"
+				,tm.tm_hour==0 ? 12
+				: tm.tm_hour>12 ? tm.tm_hour-12
+				: tm.tm_hour, tm.tm_min, tm.tm_hour>11 ? "pm":"am");
 		return(str);
 	}
 
diff --git a/src/sbbs3/con_out.cpp b/src/sbbs3/con_out.cpp
index d14859dabf801c5641521ba354a8e9656dbdfc81..6ff77a8d702ff50a335b9a81b913cddfde60e26b 100644
--- a/src/sbbs3/con_out.cpp
+++ b/src/sbbs3/con_out.cpp
@@ -458,10 +458,14 @@ void sbbs_t::ctrl_a(char x)
 		case 'T':   /* Time */
 			now=time(NULL);
 			localtime_r(&now,&tm);
-			bprintf("%02d:%02d %s"
-				,tm.tm_hour==0 ? 12
-				: tm.tm_hour>12 ? tm.tm_hour-12
-				: tm.tm_hour, tm.tm_min, tm.tm_hour>11 ? "pm":"am");
+			if(cfg.sys_misc&SM_MILITARY)
+				bprintf("%02u:%02u:%02u"
+					,tm.tm_hour, tm.tm_min, tm.tm_sec);
+			else
+				bprintf("%02d:%02d %s"
+					,tm.tm_hour==0 ? 12
+					: tm.tm_hour>12 ? tm.tm_hour-12
+					: tm.tm_hour, tm.tm_min, tm.tm_hour>11 ? "pm":"am");
 			break;
 		case 'D':   /* Date */
 			now=time(NULL);
diff --git a/src/sbbs3/js_global.c b/src/sbbs3/js_global.c
index 7c19f57041890cd5ffec446234b94104314b2bf4..d0fd4297f4cfbbfd75e0e3a011f10ff1072968c5 100644
--- a/src/sbbs3/js_global.c
+++ b/src/sbbs3/js_global.c
@@ -1934,10 +1934,14 @@ js_html_encode(JSContext *cx, uintN argc, jsval *arglist)
 					case 'T':
 						now=time(NULL);
 						localtime_r(&now,&tm);
-						j+=sprintf(outbuf+j,"%02d:%02d %s"
-							,tm.tm_hour==0 ? 12
-							: tm.tm_hour>12 ? tm.tm_hour-12
-							: tm.tm_hour, tm.tm_min, tm.tm_hour>11 ? "pm":"am");
+						if(p->cfg->sys_misc&SM_MILITARY)
+							j+=sprintf(outbuf+j,"%02d:%02d:%02d"
+								,tm.tm_hour, tm.tm_min, tm.tm_sec);
+						else
+							j+=sprintf(outbuf+j,"%02d:%02d %s"
+								,tm.tm_hour==0 ? 12
+								: tm.tm_hour>12 ? tm.tm_hour-12
+								: tm.tm_hour, tm.tm_min, tm.tm_hour>11 ? "pm":"am");
 						break;
 						
 					case 'L':