From 5fd9ec0563d0c5b3d374e5888e4aa5f1d00bbfa9 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Wed, 13 Mar 2002 18:17:17 +0000
Subject: [PATCH] Changed use of gmtime() to localtime() for systems using
 localtime rather than GMT/UTC.

---
 src/sbbs3/atcodes.cpp  |  4 ++--
 src/sbbs3/bat_xfer.cpp |  2 +-
 src/sbbs3/chat.cpp     |  2 +-
 src/sbbs3/chk_ar.cpp   |  2 +-
 src/sbbs3/con_out.cpp  |  2 +-
 src/sbbs3/data.cpp     |  4 ++--
 src/sbbs3/date_str.c   |  2 +-
 src/sbbs3/execfunc.cpp |  4 ++--
 src/sbbs3/execmisc.cpp |  2 +-
 src/sbbs3/fido.cpp     |  2 +-
 src/sbbs3/ftpsrvr.c    |  4 ++--
 src/sbbs3/js_global.c  |  2 +-
 src/sbbs3/listfile.cpp |  2 +-
 src/sbbs3/logfile.cpp  |  2 +-
 src/sbbs3/logon.cpp    |  4 ++--
 src/sbbs3/logout.cpp   |  6 +++---
 src/sbbs3/main.cpp     | 10 +++++-----
 src/sbbs3/msgtoqwk.cpp |  2 +-
 src/sbbs3/pack_qwk.cpp |  2 +-
 src/sbbs3/qwknodes.c   |  2 +-
 src/sbbs3/sbbsecho.c   | 10 +++++-----
 src/sbbs3/str.cpp      |  4 ++--
 src/sbbs3/tmp_xfer.cpp |  2 +-
 src/sbbs3/userdat.c    |  8 ++++----
 src/sbbs3/useredit.cpp |  2 +-
 src/sbbs3/xtrn.cpp     |  2 +-
 src/sbbs3/xtrn_sec.cpp | 28 ++++++++++++++--------------
 27 files changed, 59 insertions(+), 59 deletions(-)

diff --git a/src/sbbs3/atcodes.cpp b/src/sbbs3/atcodes.cpp
index 772818028e..c463ce9e5b 100644
--- a/src/sbbs3/atcodes.cpp
+++ b/src/sbbs3/atcodes.cpp
@@ -204,7 +204,7 @@ char* sbbs_t::atcode(char* sp, char* str)
 
 	if(!strcmp(sp,"TIME") || !strcmp(sp,"SYSTIME")) {
 		now=time(NULL);
-		tm_p=gmtime(&now);
+		tm_p=localtime(&now);
 		if(tm_p!=NULL)
 			tm=*tm_p;
 		else
@@ -421,7 +421,7 @@ char* sbbs_t::atcode(char* sp, char* str)
 		return(unixtodstr(&cfg,useron.laston,str));
 
 	if(!strcmp(sp,"LASTTIMEON")) {
-		tm_p=gmtime(&useron.laston);
+		tm_p=localtime(&useron.laston);
 		if(tm_p)
 			tm=*tm_p;
 		else
diff --git a/src/sbbs3/bat_xfer.cpp b/src/sbbs3/bat_xfer.cpp
index 21315ea7d9..3d1618fe7a 100644
--- a/src/sbbs3/bat_xfer.cpp
+++ b/src/sbbs3/bat_xfer.cpp
@@ -454,7 +454,7 @@ void sbbs_t::start_batch_download()
 	t=now;
 	if(cur_cps) 
 		t+=(totalsize/(ulong)cur_cps);
-	tm=gmtime(&t);
+	tm=localtime(&t);
 	if(tm==NULL)
 		return;
 	thisnode.aux=(tm->tm_hour*60)+tm->tm_min;
diff --git a/src/sbbs3/chat.cpp b/src/sbbs3/chat.cpp
index 4a7ad10bfc..96b20fd13c 100644
--- a/src/sbbs3/chat.cpp
+++ b/src/sbbs3/chat.cpp
@@ -1381,7 +1381,7 @@ void sbbs_t::guruchat(char *line, char *gurubuf, int gurunum)
 	struct	tm tm;
 
 	now=time(NULL);
-	tm_p=gmtime(&now);
+	tm_p=localtime(&now);
 	if(tm_p)
 		tm=*tm_p;
 	else
diff --git a/src/sbbs3/chk_ar.cpp b/src/sbbs3/chk_ar.cpp
index 3558dcce4c..02bed0306c 100644
--- a/src/sbbs3/chk_ar.cpp
+++ b/src/sbbs3/chk_ar.cpp
@@ -379,7 +379,7 @@ bool sbbs_t::ar_exp(uchar **ptrptr, user_t* user)
 				break;
 			case AR_TIME:
 				now=time(NULL);
-				tm=gmtime(&now);
+				tm=localtime(&now);
 				if(tm==NULL || (tm->tm_hour*60)+tm->tm_min<(int)i)
 					result=_not;
 				else
diff --git a/src/sbbs3/con_out.cpp b/src/sbbs3/con_out.cpp
index 1d1f7bd093..312feba7ba 100644
--- a/src/sbbs3/con_out.cpp
+++ b/src/sbbs3/con_out.cpp
@@ -328,7 +328,7 @@ void sbbs_t::ctrl_a(char x)
 			break;
 		case 'T':   /* Time */
 			now=time(NULL);
-			tm=gmtime(&now);
+			tm=localtime(&now);
 			if(tm!=NULL)
 				bprintf("%02d:%02d %s"
 					,tm->tm_hour==0 ? 12
diff --git a/src/sbbs3/data.cpp b/src/sbbs3/data.cpp
index ec4ab8ca96..b75633d012 100644
--- a/src/sbbs3/data.cpp
+++ b/src/sbbs3/data.cpp
@@ -202,12 +202,12 @@ void sbbs_t::gettimeleft(void)
 			|| !(cfg.event[i]->days&(1<<tm->tm_wday)))
 			continue;
 
-		tm=gmtime(&cfg.event[i]->last);
+		tm=localtime(&cfg.event[i]->last);
 		if(tm)
 			last_tm=*tm;
 		else
 			memset(&last_tm,0,sizeof(last_tm));
-		tm=gmtime(&now);
+		tm=localtime(&now);
 		if(tm==NULL)
 			return;
 		tm->tm_hour=cfg.event[i]->time/60;   /* hasn't run yet today */
diff --git a/src/sbbs3/date_str.c b/src/sbbs3/date_str.c
index 4078663635..6db6aaa874 100644
--- a/src/sbbs3/date_str.c
+++ b/src/sbbs3/date_str.c
@@ -95,7 +95,7 @@ char* DLLCALL unixtodstr(scfg_t* cfg, time_t unix_time, char *str)
 	if(!unix_time)
 		strcpy(str,"00/00/00");
 	else {
-		tm=gmtime(&unix_time);
+		tm=localtime(&unix_time);
 		if(tm==NULL) {
 			strcpy(str,"00/00/00");
 			return(str);
diff --git a/src/sbbs3/execfunc.cpp b/src/sbbs3/execfunc.cpp
index da89c2c622..4215f688f2 100644
--- a/src/sbbs3/execfunc.cpp
+++ b/src/sbbs3/execfunc.cpp
@@ -237,7 +237,7 @@ int sbbs_t::exec_function(csi_t *csi)
 		case CS_SYSTEM_LOG:                 /* System log */
 			if(!chksyspass())
 				return(0);
-			tm=gmtime(&now);
+			tm=localtime(&now);
 			if(tm==NULL)
 				return(0);
 			sprintf(str,"%slogs/%2.2d%2.2d%2.2d.log", cfg.data_dir
@@ -248,7 +248,7 @@ int sbbs_t::exec_function(csi_t *csi)
 			if(!chksyspass())
 				return(0);
 			now-=(ulong)60L*24L*60L;
-			tm=gmtime(&now);
+			tm=localtime(&now);
 			if(tm==NULL)
 				return(0);
 			sprintf(str,"%slogs/%2.2d%2.2d%2.2d.log",cfg.data_dir
diff --git a/src/sbbs3/execmisc.cpp b/src/sbbs3/execmisc.cpp
index 420ce8afec..94d61b524a 100644
--- a/src/sbbs3/execmisc.cpp
+++ b/src/sbbs3/execmisc.cpp
@@ -516,7 +516,7 @@ int sbbs_t::exec_misc(csi_t* csi, char *path)
 					lp=getintvar(csi,*(long *)csi->ip);
 					csi->ip+=4;
 					if(pp && lp) {
-						tm_p=gmtime(lp);
+						tm_p=localtime(lp);
 						if(tm_p) {
 							strftime(buf,128,str,tm_p);
 							*pp=copystrvar(csi,*pp,buf); } }
diff --git a/src/sbbs3/fido.cpp b/src/sbbs3/fido.cpp
index b67195e78c..549e444619 100644
--- a/src/sbbs3/fido.cpp
+++ b/src/sbbs3/fido.cpp
@@ -169,7 +169,7 @@ bool sbbs_t::netmail(char *into, char *title, long mode)
 	}
 
 	now=time(NULL);
-	tm=gmtime(&now);
+	tm=localtime(&now);
 	if(tm!=NULL)
 		sprintf(hdr.time,"%02u %3.3s %02u  %02u:%02u:%02u"
 			,tm->tm_mday,mon[tm->tm_mon],TM_YEAR(tm->tm_year)
diff --git a/src/sbbs3/ftpsrvr.c b/src/sbbs3/ftpsrvr.c
index 5874da0f97..7d1695c5d9 100644
--- a/src/sbbs3/ftpsrvr.c
+++ b/src/sbbs3/ftpsrvr.c
@@ -3064,7 +3064,7 @@ static void ctrl_thread(void* arg)
 				}
 				if(!strnicmp(cmd,"MDTM ",5)) {
 					t=fdate(fname);
-					tm_p=gmtime(&t);
+					tm_p=gmtime(&t);	/* specifically use GMT/UTC representation */
 					if(tm_p==NULL)
 						memset(&tm,0,sizeof(tm));
 					else
@@ -3829,7 +3829,7 @@ static void ctrl_thread(void* arg)
 				sockprintf(sock,"213 %lu",flength(fname));
 			else if(getdate && success) {
 				t=fdate(fname);
-				tm_p=gmtime(&t);
+				tm_p=gmtime(&t);	/* specifically use GMT/UTC representation */
 				if(tm_p==NULL)
 					memset(&tm,0,sizeof(tm));
 				else
diff --git a/src/sbbs3/js_global.c b/src/sbbs3/js_global.c
index 08bec81752..4809a04c71 100644
--- a/src/sbbs3/js_global.c
+++ b/src/sbbs3/js_global.c
@@ -574,7 +574,7 @@ js_strftime(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 	t=JSVAL_TO_INT(argv[1]);
 
 	strcpy(str,"-Invalid time-");
-	tm_p=gmtime(&t);
+	tm_p=localtime(&t);
 	if(tm_p)
 		strftime(str,sizeof(str),fmt,tm_p);
 
diff --git a/src/sbbs3/listfile.cpp b/src/sbbs3/listfile.cpp
index 66bada893c..b6fe962c3f 100644
--- a/src/sbbs3/listfile.cpp
+++ b/src/sbbs3/listfile.cpp
@@ -1281,7 +1281,7 @@ int sbbs_t::listfileinfo(uint dirnum, char *filespec, long mode)
 						getnodedat(cfg.node_num,&thisnode,1);
 						action=NODE_DLNG;
 						t=now+f.timetodl;
-						tm=gmtime(&t);
+						tm=localtime(&t);
 						if(tm==NULL)
 							break;
 						thisnode.aux=(tm->tm_hour*60)+tm->tm_min;
diff --git a/src/sbbs3/logfile.cpp b/src/sbbs3/logfile.cpp
index 604e2a6e66..ddb34aff47 100644
--- a/src/sbbs3/logfile.cpp
+++ b/src/sbbs3/logfile.cpp
@@ -139,7 +139,7 @@ bool sbbs_t::syslog(char* code, char *entry)
 	struct tm * tm;
 
 	now=time(NULL);
-	tm=gmtime(&now);
+	tm=localtime(&now);
 	if(tm==NULL)
 		return(false);
 	sprintf(fname,"%slogs/%2.2d%2.2d%2.2d.log",cfg.data_dir,tm->tm_mon+1,tm->tm_mday
diff --git a/src/sbbs3/logon.cpp b/src/sbbs3/logon.cpp
index c828f3589d..a70a6c0488 100644
--- a/src/sbbs3/logon.cpp
+++ b/src/sbbs3/logon.cpp
@@ -539,11 +539,11 @@ ulong sbbs_t::logonstats()
 	close(dsts);
 	if(update_t>now+(24L*60L*60L)) /* More than a day in the future? */
 		errormsg(WHERE,ERR_CHK,"Daily stats time stamp",update_t);
-	tm = gmtime(&update_t);
+	tm = localtime(&update_t);
 	if(tm==NULL)
 		return(0);
 	update_tm=*tm;
-	tm = gmtime(&now);
+	tm = localtime(&now);
 	if(tm==NULL)
 		return(0);
 	if((tm->tm_mday>update_tm.tm_mday && tm->tm_mon==update_tm.tm_mon)
diff --git a/src/sbbs3/logout.cpp b/src/sbbs3/logout.cpp
index 5b509115da..142ce5f218 100644
--- a/src/sbbs3/logout.cpp
+++ b/src/sbbs3/logout.cpp
@@ -51,7 +51,7 @@ void sbbs_t::logout()
 	struct	tm * tm, tm_now;
 
 	now=time(NULL);
-	tm=gmtime(&now);
+	tm=localtime(&now);
 	if(tm==NULL)
 		return;
 	tm_now=*tm;
@@ -232,11 +232,11 @@ void sbbs_t::logofflist()
     int file;
     struct tm * tm, tm_now;
 
-	tm=gmtime(&now);
+	tm=localtime(&now);
 	if(tm==NULL)
 		return;
 	tm_now=*tm;
-	tm=gmtime(&logontime);
+	tm=localtime(&logontime);
 	if(tm==NULL)
 		return;
 	sprintf(str,"%slogs/%2.2d%2.2d%2.2d.LOL",cfg.data_dir,tm->tm_mon+1,tm->tm_mday
diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp
index 293bdc8486..575b413043 100644
--- a/src/sbbs3/main.cpp
+++ b/src/sbbs3/main.cpp
@@ -1002,7 +1002,7 @@ void event_thread(void* arg)
 	while(!sbbs->terminated && telnet_socket!=INVALID_SOCKET) {
 
 		now=time(NULL);
-		now_tm=*gmtime(&now);
+		now_tm=*localtime(&now);
 
 		if(now-lastsemchk>=sbbs->cfg.node_sem_check) {
 			check_semaphores=true;
@@ -1270,7 +1270,7 @@ void event_thread(void* arg)
 				}
 			}
 
-			tm=gmtime(&sbbs->cfg.qhub[i]->last); /* Qnet call out based on time */
+			tm=localtime(&sbbs->cfg.qhub[i]->last); /* Qnet call out based on time */
 			if((tm==NULL || sbbs->cfg.qhub[i]->last==-1L					/* or frequency */
 				|| ((sbbs->cfg.qhub[i]->freq
 					&& (now-sbbs->cfg.qhub[i]->last)/60>sbbs->cfg.qhub[i]->freq)
@@ -1342,7 +1342,7 @@ void event_thread(void* arg)
 			if(sbbs->cfg.phub[i]->node<first_node 
 				|| sbbs->cfg.phub[i]->node>last_node)
 				continue;
-			tm=gmtime(&sbbs->cfg.phub[i]->last);	  /* PostLink call out based on time */
+			tm=localtime(&sbbs->cfg.phub[i]->last);	  /* PostLink call out based on time */
 			if(tm==NULL || sbbs->cfg.phub[i]->last==-1
 				|| (((sbbs->cfg.phub[i]->freq								/* or frequency */
 					&& (now-sbbs->cfg.phub[i]->last)/60>sbbs->cfg.phub[i]->freq)
@@ -1384,7 +1384,7 @@ void event_thread(void* arg)
 		for(i=0;i<sbbs->cfg.total_events;i++) {
 			if(!sbbs->cfg.event[i]->node || sbbs->cfg.event[i]->node>sbbs->cfg.sys_nodes)
 				continue;
-			tm=gmtime(&sbbs->cfg.event[i]->last);
+			tm=localtime(&sbbs->cfg.event[i]->last);
 			if(tm==NULL || sbbs->cfg.event[i]->last==-1 ||
 				(((sbbs->cfg.event[i]->freq 
 					&& (now-sbbs->cfg.event[i]->last)/60>sbbs->cfg.event[i]->freq)
@@ -2506,7 +2506,7 @@ void sbbs_t::catsyslog(int crash)
 			return; 
 		}
 		now=time(NULL);
-		tm=gmtime(&now);
+		tm=localtime(&now);
 		if(tm==NULL)
 			return;
 		sprintf(str,"%slogs/%2.2d%2.2d%2.2d.log",cfg.data_dir,tm->tm_mon+1,tm->tm_mday
diff --git a/src/sbbs3/msgtoqwk.cpp b/src/sbbs3/msgtoqwk.cpp
index 48d6e10658..b7cba309df 100644
--- a/src/sbbs3/msgtoqwk.cpp
+++ b/src/sbbs3/msgtoqwk.cpp
@@ -290,7 +290,7 @@ ulong sbbs_t::msgtoqwk(smbmsg_t* msg, FILE *qwk_fp, long mode, int subnum
 		size++;
 		fputc(SP,qwk_fp); }
 
-	tm_p=gmtime((time_t *)&msg->hdr.when_written.time);
+	tm_p=localtime((time_t *)&msg->hdr.when_written.time);
 	if(tm_p)
 		tm=*tm_p;
 	else
diff --git a/src/sbbs3/pack_qwk.cpp b/src/sbbs3/pack_qwk.cpp
index e3d3018638..12cba7a847 100644
--- a/src/sbbs3/pack_qwk.cpp
+++ b/src/sbbs3/pack_qwk.cpp
@@ -108,7 +108,7 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
 			return(false); }
 
 		now=time(NULL);
-		tm=gmtime(&now);
+		tm=localtime(&now);
 		if(tm==NULL)
 			return(false);
 
diff --git a/src/sbbs3/qwknodes.c b/src/sbbs3/qwknodes.c
index dfd26b9aa6..73cc2cfe9d 100644
--- a/src/sbbs3/qwknodes.c
+++ b/src/sbbs3/qwknodes.c
@@ -97,7 +97,7 @@ char * unixtodstr(time_t unix, char *str)
 if(!unix)
 	strcpy(str,"00/00/00");
 else {
-	tm=gmtime(&unix);
+	tm=localtime(&unix);
 	if(tm==NULL) {
 		strcpy(str,"00/00/00");
 		return(str);
diff --git a/src/sbbs3/sbbsecho.c b/src/sbbs3/sbbsecho.c
index dfaec59e7a..3604f42351 100644
--- a/src/sbbs3/sbbsecho.c
+++ b/src/sbbs3/sbbsecho.c
@@ -397,7 +397,7 @@ do {
 	sprintf(hdr.from,"SBBSecho");
 
 	t=time(NULL);
-	tm=gmtime(&t);
+	tm=localtime(&t);
 	sprintf(hdr.time,"%02u %3.3s %02u  %02u:%02u:%02u"
 		,tm->tm_mday,mon[tm->tm_mon],TM_YEAR(tm->tm_year)
 		,tm->tm_hour,tm->tm_min,tm->tm_sec);
@@ -2616,7 +2616,7 @@ char *pktname(void)
 now=time(NULL);
 for(i=0;i<MAX_TOTAL_PKTS*2;i++) {
 	now+=i;
-	tm=gmtime(&now);
+	tm=localtime(&now);
 	sprintf(str,"%s%02u%02u%02u%02u.PK_",cfg.outbound,tm->tm_mday,tm->tm_hour
 		,tm->tm_min,tm->tm_sec);
 	if(!fexist(str))				/* Add 1 second if name exists */
@@ -3120,7 +3120,7 @@ for(j=0;j<area.uplinks;j++) {
 						break; } }
 			strcpy(outpkt[i].filename,pktname());
 			now=time(NULL);
-			tm=gmtime(&now);
+			tm=localtime(&now);
 			if((outpkt[i].stream=fnopen(&file,outpkt[i].filename
 				,O_WRONLY|O_CREAT))==NULL) {
 				printf("Unable to open %s for write.\n"
@@ -3607,7 +3607,7 @@ void export_echomail(char *sub_code,faddr_t addr)
 
 				sprintf(hdr.from,"%.35s",msg.from);
 
-				tm=gmtime((time_t *)&msg.hdr.when_written.time);
+				tm=localtime((time_t *)&msg.hdr.when_written.time);
 				sprintf(hdr.time,"%02u %3.3s %02u  %02u:%02u:%02u"
 					,tm->tm_mday,mon[tm->tm_mon],TM_YEAR(tm->tm_year)
 					,tm->tm_hour,tm->tm_min,tm->tm_sec);
@@ -4685,7 +4685,7 @@ for(f=0;f<g.gl_pathc && !kbhit();f++) {
 		strcpy(packet,pktname());
 
 	now=time(NULL);
-	tm=gmtime(&now);
+	tm=localtime(&now);
 	if((stream=fnopen(&file,packet,O_WRONLY|O_APPEND|O_CREAT))==NULL) {
 		printf("Unable to open %s for write.\n"
 			,packet);
diff --git a/src/sbbs3/str.cpp b/src/sbbs3/str.cpp
index 99f3b03d0a..c70b5f5949 100644
--- a/src/sbbs3/str.cpp
+++ b/src/sbbs3/str.cpp
@@ -529,7 +529,7 @@ bool sbbs_t::inputnstime(time_t *dt)
 	bputs(text[NScanDate]);
 	bputs(timestr(dt));
 	CRLF;
-	tp=gmtime(dt);
+	tp=localtime(dt);
 	if(tp==NULL) {
 		errormsg(WHERE,ERR_CHK,"time ptr",0);
 		return(FALSE);
@@ -889,7 +889,7 @@ void sbbs_t::user_info()
 
 	bprintf(text[UserStats],useron.alias,useron.number);
 
-	tm=gmtime(&useron.laston);
+	tm=localtime(&useron.laston);
 	if(tm!=NULL)
 		bprintf(text[UserDates]
 			,unixtodstr(&cfg,useron.firston,str)
diff --git a/src/sbbs3/tmp_xfer.cpp b/src/sbbs3/tmp_xfer.cpp
index a6bafa7855..e7f5475651 100644
--- a/src/sbbs3/tmp_xfer.cpp
+++ b/src/sbbs3/tmp_xfer.cpp
@@ -170,7 +170,7 @@ void sbbs_t::temp_xfer()
 					t=now;
 					if(cur_cps) 
 						t+=(f.size/(ulong)cur_cps);
-					tm=gmtime(&t);
+					tm=localtime(&t);
 					if(tm==NULL)
 						break;
 					thisnode.aux=(tm->tm_hour*60)+tm->tm_min;
diff --git a/src/sbbs3/userdat.c b/src/sbbs3/userdat.c
index a873df7934..a68540ce72 100644
--- a/src/sbbs3/userdat.c
+++ b/src/sbbs3/userdat.c
@@ -607,7 +607,7 @@ char DLLCALL getage(scfg_t* cfg, char *birth)
 		return(0);
 
 	now=time(NULL);
-	tm=gmtime(&now);
+	tm=localtime(&now);
 	if(tm==NULL)
 		return(0);
 	age=(tm->tm_year)-(((birth[6]&0xf)*10)+(birth[7]&0xf));
@@ -1046,7 +1046,7 @@ static BOOL ar_exp(scfg_t* cfg, uchar **ptrptr, user_t* user)
 				break;
 			case AR_TIME:
 				now=time(NULL);
-				tm=gmtime(&now);
+				tm=localtime(&now);
 				if(tm==NULL || (tm->tm_hour*60)+tm->tm_min<(int)i)
 					result=not;
 				else
@@ -1375,12 +1375,12 @@ BOOL DLLCALL logoutuserdat(scfg_t* cfg, user_t* user, time_t now, time_t logonti
 	adjustuserrec(cfg,user->number,U_TTODAY,5,user->tlast);
 
 	/* Convert time_t to struct tm */
-	tm=gmtime(&now);
+	tm=localtime(&now);
 	if(tm==NULL)
 		return(FALSE);
 	tm_now=*tm;
 
-	tm=gmtime(&logontime);
+	tm=localtime(&logontime);
 	if(tm==NULL)
 		return(FALSE);
 
diff --git a/src/sbbs3/useredit.cpp b/src/sbbs3/useredit.cpp
index 6e652bd500..2b702c167c 100644
--- a/src/sbbs3/useredit.cpp
+++ b/src/sbbs3/useredit.cpp
@@ -121,7 +121,7 @@ void sbbs_t::useredit(int usernumber)
 				,user.comment);
 		else
 			CRLF;
-		tm=gmtime(&user.laston);
+		tm=localtime(&user.laston);
 		if(tm==NULL)
 			return;
 		bprintf(text[UserDates]
diff --git a/src/sbbs3/xtrn.cpp b/src/sbbs3/xtrn.cpp
index 1e67e08259..84416856b0 100644
--- a/src/sbbs3/xtrn.cpp
+++ b/src/sbbs3/xtrn.cpp
@@ -284,7 +284,7 @@ int sbbs_t::external(char* cmdline, long mode, char* startup_dir)
 	strcpy(realcmdline, fullcmdline);	// for errormsg if failed to execute
 
 	now=time(NULL);
-	tm_p=gmtime(&now);
+	tm_p=localtime(&now);
 
 	if((retval=WaitForSingleObject(exec_mutex,5000))!=WAIT_OBJECT_0) {
 		errormsg(WHERE, ERR_TIMEOUT, "exec_mutex", retval);
diff --git a/src/sbbs3/xtrn_sec.cpp b/src/sbbs3/xtrn_sec.cpp
index bf4376b5ef..ce1ca25855 100644
--- a/src/sbbs3/xtrn_sec.cpp
+++ b/src/sbbs3/xtrn_sec.cpp
@@ -213,7 +213,7 @@ int unixtojulian(time_t unix_time)
 	long j;
 	struct tm * tm;
 
-	tm=gmtime(&unix_time);
+	tm=localtime(&unix_time);
 	if(tm==NULL)
 		return(0);
 	j=36525L*(1900+tm->tm_year);
@@ -508,7 +508,7 @@ void sbbs_t::xtrndat(char *name, char *dropdir, uchar type, ulong tleft
 			,'Y');                              /* 38: Error correcting connection */
 		write(file,str,strlen(str));
 
-		tm=gmtime(&ns_time);
+		tm=localtime(&ns_time);
 		if(tm!=NULL)
 		sprintf(str,"%c\r\n%c\r\n%u\r\n%lu\r\n%02d/%02d/%02d\r\n"
 			,(useron.misc&(NO_EXASCII|ANSI|COLOR))==ANSI
@@ -521,8 +521,8 @@ void sbbs_t::xtrndat(char *name, char *dropdir, uchar type, ulong tleft
 			,TM_YEAR(tm->tm_year));
 		write(file,str,strlen(str));
 
-		tm=gmtime(&logontime);
-		tl=gmtime(&useron.laston);
+		tm=localtime(&logontime);
+		tl=localtime(&useron.laston);
 		if(tm!=NULL && tl!=NULL)
 		sprintf(str,"%02d:%02d\r\n%02d:%02d\r\n%u\r\n%u\r\n%lu\r\n"
 			"%lu\r\n%s\r\n%u\r\n%u\r\n"
@@ -614,7 +614,7 @@ void sbbs_t::xtrndat(char *name, char *dropdir, uchar type, ulong tleft
 		str2pas(useron.phone,str);
 		write(file,str,13); 					/* DataPhone */
 		write(file,str,13); 					/* HomePhone */
-		tm=gmtime(&useron.laston);
+		tm=localtime(&useron.laston);
 		if(tm!=NULL)
 			sprintf(tmp,"%02d:%02d",tm->tm_hour,tm->tm_min);
 		str2pas(tmp,str);
@@ -676,7 +676,7 @@ void sbbs_t::xtrndat(char *name, char *dropdir, uchar type, ulong tleft
 		write(file,&c,1);						/* NetMailEntered */
 		write(file,&c,1);						/* EchoMailEntered */
 
-		tm=gmtime(&logontime);
+		tm=localtime(&logontime);
 		if(tm!=NULL)
 			sprintf(tmp,"%02d:%02d",tm->tm_hour,tm->tm_min);
 		str2pas(tmp,str);
@@ -763,7 +763,7 @@ void sbbs_t::xtrndat(char *name, char *dropdir, uchar type, ulong tleft
 			,useron.number);					/* User number */
 		write(file,str,strlen(str));
 
-		tm=gmtime(&now);
+		tm=localtime(&now);
 		if(tm!=NULL)
 		sprintf(str,"%lu\r\n%02d:%02d\r\n%02d:%02d %02d/%02d/%02d\r\n%s\r\n"
 			,tleft								/* Time left in seconds */
@@ -774,7 +774,7 @@ void sbbs_t::xtrndat(char *name, char *dropdir, uchar type, ulong tleft
 			,nulstr);							/* Conferences with access */
 		write(file,str,strlen(str));
 
-		tm=gmtime(&useron.laston);
+		tm=localtime(&useron.laston);
 		if(tm!=NULL)
 		sprintf(str,"%u\r\n%u\r\n%u\r\n%u\r\n%s\r\n%s %02u:%02u\r\n"
 			,0									/* Daily download total */
@@ -787,7 +787,7 @@ void sbbs_t::xtrndat(char *name, char *dropdir, uchar type, ulong tleft
 			,tm->tm_min);
 		write(file,str,strlen(str));
 
-		tm=gmtime(&ns_time);
+		tm=localtime(&ns_time);
 		if(tm!=NULL)
 		sprintf(str,"%s\r\n%s\r\n%02d/%02d/%02d\r\n%u\r\n%lu\r\n%u"
 			"\r\n%u\r\n%u\r\n"
@@ -813,7 +813,7 @@ void sbbs_t::xtrndat(char *name, char *dropdir, uchar type, ulong tleft
 			,"Normal Connection");              /* Normal or ARQ connect */
 		write(file,str,strlen(str));
 
-		tm=gmtime(&now);
+		tm=localtime(&now);
 		if(tm!=NULL)
 		sprintf(str,"%02d/%02d/%02d %02d:%02d\r\n%u\r\n%u\r\n"
 			,tm->tm_mon+1,tm->tm_mday			/* Current date MM/DD/YY */
@@ -858,7 +858,7 @@ void sbbs_t::xtrndat(char *name, char *dropdir, uchar type, ulong tleft
 			,useron.pass);						/* User's password */
 		write(file,str,27);
 
-		tm=gmtime(&logontime);
+		tm=localtime(&logontime);
 		if(tm==NULL)
 			i=0;
 		else
@@ -965,7 +965,7 @@ void sbbs_t::xtrndat(char *name, char *dropdir, uchar type, ulong tleft
 		write(file,useron.phone,14);	/* Home or Voice Phone */
 		i=unixtojulian(useron.laston);
 		write(file,&i,2);				/* Date last on */
-		tm=gmtime(&useron.laston);
+		tm=localtime(&useron.laston);
 		if(tm!=NULL)
 			sprintf(str,"%02d:%02d",tm->tm_hour,tm->tm_min);
 		write(file,str,6);				/* Last time on */
@@ -1030,7 +1030,7 @@ void sbbs_t::xtrndat(char *name, char *dropdir, uchar type, ulong tleft
 		}
 
 		now=time(NULL);
-		tm=gmtime(&now);
+		tm=localtime(&now);
 		if(tm==NULL)
 			l=0;
 		else
@@ -1053,7 +1053,7 @@ void sbbs_t::xtrndat(char *name, char *dropdir, uchar type, ulong tleft
 			);
 		write(file,str,strlen(str));
 
-		tm=gmtime(&logontime);
+		tm=localtime(&logontime);
 		if(tm==NULL)
 			l=0;
 		else
-- 
GitLab