Skip to content
Snippets Groups Projects
Commit 17c95b75 authored by rswindell's avatar rswindell
Browse files

Added UPTIME @-Code to display days, hours, and minutes up.

parent 07efbbe9
No related branches found
No related tags found
No related merge requests found
...@@ -101,6 +101,21 @@ int sbbs_t::atcodes(char *instr) ...@@ -101,6 +101,21 @@ int sbbs_t::atcodes(char *instr)
bputs(str2); bputs(str2);
} }
else if(!strcmp(sp,"UPTIME")) {
extern time_t uptime;
time_t up=time(NULL)-uptime;
char days[64]="";
if((up/(24*60*60))>=2) {
sprintf(days,"%u days ",up/(24*60*60));
up%=(24*60*60);
}
bprintf("%s%u:%02u"
,days
,up/(60*60)
,(up/60)%60
);
}
else if(!strcmp(sp,"SOCKET_LIB")) else if(!strcmp(sp,"SOCKET_LIB"))
bputs(socklib_version(str2)); bputs(socklib_version(str2));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment