如何将DWORD类型转换成时间类型? 如何将DWORD类型转换成时间类型?能介绍其它类型转换成时间类型的函数吗?? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 CTime t(dwTime);COleDateTime tmBase (t.GetYear(),t.GetMonth(),t.GetDay(),t.GetHour(),t.GetMinute(),t.GetSecond());偶用COleDateTime用习惯了,所以就把它转换成COleDateTime吧 我的dword是1052982295(是读取日志中的信息pevlr->TimeWritten得到的,我想将其分离成正规的日期格式)年月日 和时间 如何作阿? CTime类中记录时间的成员变量就是long 类型的,偶只好猜它是CTime格式啦,可以这样做:DWORD dwTime = 1052982295;CTime t(dwTime);然后可以用以下函数t.GetYear()t.GetMonth()t.GetDay()t.GetHour()t.GetMinute()t.GetSecond() sorryDWORD dwTime = 1052982295;是从1970年1月1日00:00:00 开始的秒数(This time is measured in the number of seconds elapsed since January 1, 1970, Universal Coordinated Time)我该如何转换成时间的年月日阿? // 算法思想大致如下:long SecondsPerDay = 86400;long SecondsPerMonth = 86400 * 30;long SecondsPerYear = 86400 * 365;long SecondsPerHour = 3600long SecondsPerMinute = 60long Years, Months, Days, Hours, Minutes, Seconds, Remain; Years = dwTime /SecondsPerYear; Remain = dwTime % SecondsPerYear; Months = Remain /SecondsPerMonth; Remain = Remain % SecondsPerMonth; Days = Remain/ SecondsPerDay; Remain = Remain % SecondsPerDay; Hours = Remain / SecondsPerHour; Remain = Remain % SecondsPerHour; Minutes = Remain / SecondsPerMinute; Remain = Remain % SecondsPerMinute; Seconds = Remain; NowYear = 1970 + Years; NowMonth = Months; NowDay = Days; NowHour = Hours; NowMinute = Minutes; NowSecond = Seconds; 关于CBCGPEditCtrl类中文处理问题 问个修改注册表的问题 请问使用_beginthread要做那些准备工作 请教关于SHFILEOPSTRUCT的问题 怎样在程序中播放flash动画 如何用AT命令modem拨号上网?其他程序怎么使用这个拨号连接?急!! 使用MSXML,如何得到节点所在的行数! 哥们儿,哪里有《深入浅出MFC》的电子版?谢了! 急,非常紧急,各位同仁们,清帮忙 C++读取配置文件改变界面数量 高分求救::线程中传递参数问题!!!!!!! 现在哪里有InstallShield6.0下载呀,不要7.0的
COleDateTime tmBase (t.GetYear(),t.GetMonth(),t.GetDay(),t.GetHour(),t.GetMinute(),t.GetSecond());
偶用COleDateTime用习惯了,所以就把它转换成COleDateTime吧
(是读取日志中的信息pevlr->TimeWritten得到的,我想将其分离成正规的日期格式)
年月日 和时间
如何作阿?
DWORD dwTime = 1052982295;
CTime t(dwTime);然后可以用以下函数
t.GetYear()
t.GetMonth()
t.GetDay()t.GetHour()
t.GetMinute()
t.GetSecond()
DWORD dwTime = 1052982295;
是从1970年1月1日00:00:00 开始的秒数(This time is measured in the number of seconds elapsed since January 1, 1970, Universal Coordinated Time)我该如何转换成时间的年月日阿?
long SecondsPerMonth = 86400 * 30;
long SecondsPerYear = 86400 * 365;long SecondsPerHour = 3600
long SecondsPerMinute = 60long Years, Months, Days, Hours, Minutes, Seconds, Remain;
Years = dwTime /SecondsPerYear;
Remain = dwTime % SecondsPerYear;
Months = Remain /SecondsPerMonth;
Remain = Remain % SecondsPerMonth;
Days = Remain/ SecondsPerDay;
Remain = Remain % SecondsPerDay;
Hours = Remain / SecondsPerHour;
Remain = Remain % SecondsPerHour;
Minutes = Remain / SecondsPerMinute;
Remain = Remain % SecondsPerMinute;
Seconds = Remain; NowYear = 1970 + Years;
NowMonth = Months;
NowDay = Days;
NowHour = Hours;
NowMinute = Minutes;
NowSecond = Seconds;