怎么得到GMT时间?(50分)

  • 主题发起人 主题发起人 Andy Xie
  • 开始时间 开始时间
A

Andy Xie

Unregistered / Unconfirmed
GUEST, unregistred user!
如上,怎么用delphi实现?
 
怎么一个人都没有啊?
 
const<br>&nbsp; MinsPerDay = 24 * 60;<br><br>function GetGMTBias: Integer;<br>var<br>&nbsp; info: TTimeZoneInformation;<br>&nbsp; Mode: DWord;<br>begin<br>&nbsp; Mode := GetTimeZoneInformation(info);<br>&nbsp; Result := info.Bias;<br>&nbsp; case Mode of<br>&nbsp; &nbsp; TIME_ZONE_ID_INVALID: RaiseLastOSError;<br>&nbsp; &nbsp; TIME_ZONE_ID_STANDARD: Result := Result + info.StandardBias;<br>&nbsp; &nbsp; TIME_ZONE_ID_DAYLIGHT: Result := Result + info.DaylightBias;<br>&nbsp; end;<br>end;<br><br>function LocaleToGMT(const Value: TDateTime): TDateTime;<br>{<br>&nbsp; 把本地时间Value转换成GMT/UTC时间<br>}<br>begin<br>&nbsp; Result := Value + (GetGMTBias / MinsPerDay);<br>end;<br><br>function GMTToLocale(const Value: TDateTime): TDateTime;<br>{<br>&nbsp; 把GMT/UTC时间Value转换成本地时间<br>}<br>begin<br>&nbsp; Result := Value - (GetGMTBias / MinsPerDay);<br>end;<br>
 
接受答案了.
 
GetSystemTime函数就是获得GMT时间!
 
后退
顶部