⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 timefun.c

📁 这是用Labwindows开发的一个RF test程序。 用于日本机种的组装后ANT 测试。
💻 C
字号:
#include <utility.h>
#include <ansi_c.h>
#include "def.h"
char* GetSystemYear(char *str)
{
	char year[5];
	int status;
	struct DateType SystemDate;
	status = GetSystemDate (&SystemDate.month, &SystemDate.day, &SystemDate.year);	
	year[0]=SystemDate.year/1000+48;
	year[1]=(SystemDate.year-(year[0]-48)*1000)/100+48;
	year[2]=(SystemDate.year-(year[0]-48)*1000-(year[1]-48)*100)/10+48;
	year[3]=(SystemDate.year-(year[0]-48)*1000-(year[1]-48)*100-(year[2]-48)*10)+48;	
	year[4]='\0';
	strcpy(str,year);
	return str;
}

char* GetSystemMonth(char *str)
{
	char month[3];
	int status;
	struct DateType SystemDate;
	status = GetSystemDate (&SystemDate.month, &SystemDate.day, &SystemDate.year);	
	month[0]=SystemDate.month/10+48;
	month[1]=SystemDate.month-(month[0]-48)*10+48;
	month[2]='\0';
	strcpy(str,month);
	return str;
}

char* GetSystemDay(char *str)
{
	char day[3];
	int status;
	struct DateType SystemDate;
	status = GetSystemDate (&SystemDate.month, &SystemDate.day, &SystemDate.year);	
	day[0]=SystemDate.day/10+48;
	day[1]=SystemDate.day-(day[0]-48)*10+48;
	day[2]='\0';
	strcpy(str,day);
	return str;
}

char* GetSystemHour(char *str)
{
	char hour[3];
	int status;
	struct TimeType SystemTime;
	status = GetSystemTime (&SystemTime.hour,&SystemTime.minute,&SystemTime.second);
	hour[0]=SystemTime.hour/10+48;
	hour[1]=SystemTime.hour-(hour[0]-48)*10+48;
	hour[2]='\0';
	strcpy(str,hour);
	return str;
}

char* GetSystemMinute(char *str)
{
	char minute[3];
	int status;
	struct TimeType SystemTime;
	status = GetSystemTime (&SystemTime.hour,&SystemTime.minute,&SystemTime.second);
	minute[0]=SystemTime.minute/10+48;
	minute[1]=SystemTime.minute-(minute[0]-48)*10+48;
	minute[2]='\0';
	strcpy(str,minute);
	return str;
}

char* GetSystemSecond(char *str)
{
	char second[3];
	int status;
	struct TimeType SystemTime;
	status = GetSystemTime (&SystemTime.hour,&SystemTime.minute,&SystemTime.second);
	second[0]=SystemTime.second/10+48;
	second[1]=SystemTime.second-(second[0]-48)*10+48;
	second[2]='\0';
	strcpy(str,second);
	return str;
}

⌨️ 快捷键说明

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