速要一程序代码:关于编一个钟表的程序且与计算机的时间一致,能在tb2.0上调试,用c语言编的
速要一程序代码:关于编一个钟表的程序且与计算机的时间一致,能在tb2.0上调试,用c语言编的 问题点数:20、回复次数:2Top
1 楼chenhu_doc(^0^纯一狼^0^ 看书看到大笑,直到不能自已)回复于 2006-06-03 23:18:48 得分 0
#include <time.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/timeb.h>
#include <string.h>
int main()
{
char tmpbuf[128], ampm[] = "AM";
_strtime( tmpbuf );
printf( "OS time:\t\t\t\t%s\n", tmpbuf );
_strdate( tmpbuf );
printf( "OS date:\t\t\t\t%s\n", tmpbuf );
getchar();
return 0;
}
Top
2 楼cattlenzq(吃狼的豆腐(不要给分了,散起来真麻烦!))回复于 2006-06-04 00:37:25 得分 0
tb2是??
怎么好象没听过啊。。。。。。。。
不过标准c里有这个啊
这个应该可以吧
ctime
语法:
#include <time.h>
char *ctime( const time_t *time );
功能:函数转换参数time为本地时间格式:
day month date hours:minutes:seconds year\n\0
Top




