wince下time的api???

joalin   2009-6-26 10:13 楼主
比如一个LPSYSTEMTIME,要得到它加上8小时后的LPSYSTEMTIME,有什么api吗??

回复评论 (7)

没做过,但帮助中有相关说明:


Remarks
It is not recommended that you add and subtract values from this structure to obtain relative times.

The following list shows tasks to perform instead:

Convert the SYSTEMTIME structure to a FILETIME structure.
Copy the resulting FILETIME structure to a ULARGE_INTEGER structure.
Use usual 64-bit arithmetic on the ULARGE_INTEGER value.
点赞  2009-6-26 10:49
LZ要做timezone转换?
GetSystemTime(...);
点赞  2009-6-26 10:58
呵呵,本地时区使用 GetLocalTime 函数

取得的就是北京时间,不需要转换了。
点赞  2009-6-26 11:07
这个问题问倒我了,其实就是个时间进位问题,建议你用转换为FILETIME之后再操作

Millisecond granularity may not be supported by a hardware platform. The caller of this function should not rely on more than second granularity. It is not recommended that you add and subtract values from this structure to obtain relative times.

The following list shows tasks to perform instead:

Convert the SYSTEMTIME structure to a FILETIME structure.


Copy the resulting FILETIME structure to a ULARGE_INTEGER structure.


Use usual 64-bit arithmetic on the ULARGE_INTEGER value.
点赞  2009-6-26 14:36
引用: 引用 3 楼 zaodt 的回复:
呵呵,本地时区使用 GetLocalTime 函数

取得的就是北京时间,不需要转换了。


  然后用CString 格式化的时候 操作一下具体的时间 就对了
点赞  2009-6-26 22:21

7楼 icu 

GetLocalTime()
点赞  2009-6-28 21:30
o
点赞  2009-6-29 09:54
电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 京公网安备 11010802033920号
    写回复