timedate.h

来自「source code for a sample alarm control p」· C头文件 代码 · 共 55 行

H
55
字号
//=============================================================================
// File: TIMEDATE.H - V1.00
// Rem.: The ACPRD Project Page on the Web -> http://hc12web.de/acprd
//=============================================================================

#ifndef __TIMEDATE_H
#define __TIMEDATE_H

//-- Definitions --------------------------------------------------------------

//#define __USE_ASCTIME		// uncomment to add funcs asctime(), ctime()

//-- Includes -----------------------------------------------------------------

//-- Datatype Definitions -----------------------------------------------------

typedef UINT32 time_t;

struct tm {
	UINT8  tm_sec;		// 0..59
	UINT8  tm_min;		// 0..59
	UINT8  tm_hour;		// 0..23
	UINT8  tm_wday;		// 0(Sunday)..6
	UINT8  tm_mday;		// 1..31 (!!)
	UINT8  tm_mon;		// 0..11
	UINT16 tm_yday;		// 0..365
	UINT8  tm_year;		// year-1900
	INT8   tm_isdst;	// 0 ***
	};
// *** = not implemented, do not use

//-- Extern Declarations ------------------------------------------------------

extern volatile time_t systime;

//-- Macros -------------------------------------------------------------------

#define inctime()	systime++
#define gettimep()	((const time_t *)(&systime))

//-- Function Prototypes ------------------------------------------------------

time_t time(time_t *tptr);
UINT16 stime(time_t *tptr);
struct tm *gmtime(const time_t *tptr);
time_t mktime(struct tm *tmptr);

#ifdef __USE_ASCTIME
UINT8 *asctime(struct tm *tmptr);
UINT8 *ctime(time_t *tptr);
#endif //__USE_ASCTIME

#endif //__TIMEDATE_H =========================================================

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?