读书人

在C++builder中UCT如何转换datetiem

发布时间: 2013-06-25 23:45:41 作者: rapoo

在C++builder中UCT怎么转换datetiem?
在C++builder中UCT怎么转换datetiem
[解决办法]
用indy吧

#include <IDGLOBAL.hpp>
System::TDateTime __fastcall GMTToLocalDateTime(AnsiString S);
[解决办法]
或者直接用API

GetTimeZoneInformation(TIME_ZONE_INFORMATION* tzi);
WINBASEAPI
DWORD
WINAPI
GetTimeZoneInformation(
OUT LPTIME_ZONE_INFORMATION lpTimeZoneInformation
);

// lpTimeZoneInformation.Bias 就是时差
[解决办法]
GMTToLocalDateTime 需要传入一个UTC日期时间格式字符串做参数


TDateTime dt = GMTToLocalDateTime("Sun 15 Oct 2000 12:42:15 -0500");
ShowMessage(dt.CurrentDate());

cb6 + indy9
[解决办法]
FormatDateTime 格式化为字串
http://blog.csdn.net/happybuttom/article/details/2844028

读书人网 >C++ Builder

热点推荐