Skip to content
Snippets Groups Projects
  • Rob Swindell's avatar
    a893b66f
    Add option to display short dates in verbal/unambiguous formats · a893b66f
    Rob Swindell authored
    Although we've added (in SBBS v3.20) configurable numeric date input/display
    formats for the system, the output was still ambiguous for users (e.g.
    NN/NN/NN which could be interpretted a number of ways), so I've added an option
    to choose "verbal" short date formats to be displayed where possible instead.
    The same value separate from the numeric format (whatever the sysop chose) is
    used in the verbal date output, but since month name abbreviations are 3
    characters, only one separator is used (to keep the output length fixed at 8
    characters).
    
    The new "Verbal" short date display format is choosable in the SCFG wizard and
    via SCFG->System->Short Date Format.
    a893b66f
    History
    Add option to display short dates in verbal/unambiguous formats
    Rob Swindell authored
    Although we've added (in SBBS v3.20) configurable numeric date input/display
    formats for the system, the output was still ambiguous for users (e.g.
    NN/NN/NN which could be interpretted a number of ways), so I've added an option
    to choose "verbal" short date formats to be displayed where possible instead.
    The same value separate from the numeric format (whatever the sysop chose) is
    used in the verbal date output, but since month name abbreviations are 3
    characters, only one separator is used (to keep the output length fixed at 8
    characters).
    
    The new "Verbal" short date display format is choosable in the SCFG wizard and
    via SCFG->System->Short Date Format.
date_str.h 2.00 KiB
/* Synchronet date/time string conversion routines */

/****************************************************************************
 * @format.tab-size 4		(Plain Text/Source Code File Header)			*
 * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
 *																			*
 * Copyright Rob Swindell - http://www.synchro.net/copyright.html			*
 *																			*
 * This program is free software; you can redistribute it and/or			*
 * modify it under the terms of the GNU General Public License				*
 * as published by the Free Software Foundation; either version 2			*
 * of the License, or (at your option) any later version.					*
 * See the GNU General Public License for more details: gpl.txt or			*
 * http://www.fsf.org/copyleft/gpl.html										*
 *																			*
 * For Synchronet coding style and modification guidelines, see				*
 * http://www.synchro.net/source.html										*
 *																			*
 * Note: If this box doesn't appear square, then you need to fix your tabs.	*
 ****************************************************************************/

#ifndef _DATE_STR_H_
#define _DATE_STR_H_

#include "scfgdefs.h"	// scfg_t
#include "dllexport.h"

#ifdef __cplusplus
extern "C" {
#endif

extern const char* wday[];	/* abbreviated weekday names */
extern const char* mon[];	/* abbreviated month names */

DLLEXPORT char *	date_format(scfg_t*, char* buf, size_t);
DLLEXPORT char *	date_template(scfg_t*, char* buf, size_t);
DLLEXPORT char *	zonestr(short zone);
DLLEXPORT time32_t	dstrtounix(scfg_t*, const char *str);
DLLEXPORT char *	unixtodstr(scfg_t*, time32_t, char *str);
DLLEXPORT char *	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);
DLLEXPORT char *	timestr(scfg_t* cfg, time32_t intime, char* str);
DLLEXPORT char*		minutes_to_str(uint min, char* str, size_t);

#ifdef __cplusplus
}
#endif
#endif /* Don't add anything after this line */