Skip to content
Snippets Groups Projects
Commit 97cfb894 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Add verbal_datestr()

For cases where we want to the verbal short date output, regardless of sysop
preference/configuration.
parent f2f59582
Branches
Tags
No related merge requests found
......@@ -158,6 +158,13 @@ char* datestr(scfg_t* cfg, time_t t, char* str)
return "---------";
if(!cfg->sys_date_verbal)
return unixtodstr(cfg, (time32_t)t, str);
return verbal_datestr(cfg, t, str);
}
/****************************************************************************/
/****************************************************************************/
char* verbal_datestr(scfg_t* cfg, time_t t, char* str)
{
struct tm tm = {0};
if(localtime_r(&t, &tm) == NULL)
return "!!!!!!!!!";
......
......@@ -38,6 +38,7 @@ DLLEXPORT char * zonestr(short zone);
DLLEXPORT time32_t dstrtounix(enum date_fmt, const char *str);
DLLEXPORT char * unixtodstr(scfg_t*, time32_t, char *str);
DLLEXPORT char * datestr(scfg_t*, time_t, char* str);
DLLEXPORT char * verbal_datestr(scfg_t*, time_t, char* str);
DLLEXPORT char * sectostr(uint sec, char *str);
DLLEXPORT char * seconds_to_str(uint, char*);
DLLEXPORT char * hhmmtostr(scfg_t* cfg, struct tm* tm, char* str);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment