标题:用getsystemtime获取的时间为什么小时不对
只看楼主
lizhicheng
Rank: 1
等 级:新手上路
帖 子:48
专家分:0
注 册:2007-8-12
 问题点数:0 回复次数:2 
用getsystemtime获取的时间为什么小时不对

RTRTRT...

搜索更多相关主题的帖子: 获取 时间 RTRTRT 
2007-08-22 15:38
cordier
Rank: 2
等 级:论坛游民
威 望:1
帖 子:449
专家分:14
注 册:2006-2-9
得分:0 

struct time {
unsigned char ti_min; /* Minutes */
unsigned char ti_hour; /* Hours */
unsigned char ti_hund; /* Hundredths of seconds */
unsigned char ti_sec; /* Seconds */
};

上面是DOS.h中的。


你把它换成整形看一下。(我是指你输出的时候,用整形输出)
#include <dos.h>

main()
{
struct time now;
gettime(&now);
printf("%d",now.ti_hour);
getch();
}

[此贴子已经被作者于2007-8-22 19:18:21编辑过]


2007-08-22 18:57
雨中飞燕
Rank: 3Rank: 3
等 级:禁止访问
威 望:8
帖 子:2200
专家分:0
注 册:2007-8-9
得分:0 
看见楼上的代码,真觉得无语
2007-08-22 19:00



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-164615-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.680424 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved