📄 datetime.c
字号:
/* * 日期和时间转换例程 */#include "../inc/screen.h"struct tm *localtime();void xdate(date0)struct date *date0;{ unsigned int ymdx; ymdx = date0->ymd; date0->day = ymdx & 0x1f; date0->month = (ymdx >> 5) & 0xf; date0->year = ((ymdx >> 9) & 0x7f) + 1979 ;}void ydate(date0)struct date *date0;{ unsigned int ymdx; ymdx = 0; ymdx = ymdx | (date0->day & 0x1f); ymdx = ymdx | ((date0->month << 5) & 0x1e0); ymdx = ymdx | (((date0->year - 1979 ) << 9) & 0xfe00); date0->ymd = ymdx;}/* * 用汉字显示星期几 */char *wtoday(today)int today;{ static char strx[3]; switch(today) { case 1: sprintf(strx,"一"); break; case 2: sprintf(strx,"二"); break; case 3: sprintf(strx,"三"); break; case 4: sprintf(strx,"四"); break; case 5: sprintf(strx,"五"); break; case 6: sprintf(strx,"六"); break; case 7: sprintf(strx,"日"); break; default: sprintf(strx,"xx"); break; } return(strx);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -