VC中 time_t 类型如何转换成Delphi的 TDateTime!!!急!!!(50分)

  • 主题发起人 主题发起人 pcexplorer
  • 开始时间 开始时间
P

pcexplorer

Unregistered / Unconfirmed
GUEST, unregistred user!
如题<br>急急急急<br>!!!!
 
time_t是指针(long int)Pointer to stored time<br>TDateTime是double<br>The integral part of a TDateTime value is the number of days that have passed since 12/30/1899.<br>The fractional part of a TDateTime value is fraction of a 24 hour day that has elapsed.<br><br>你如何转换?<br>vc用time_t<br>delphi用double<br>大大的不同,哈哈!
 
我已经找到答案了:MSDN<br>function gmtime(const ptime:ptime_t):ptm;cdecl;external 'MSVCRT.dll';//API<br>//好象用stdcall不行用cdecl可以<br>type<br>&nbsp; tm = record<br>&nbsp; &nbsp; tm_sec: Integer;<br>&nbsp; &nbsp; tm_min: Integer;<br>&nbsp; &nbsp; tm_hour: Integer;<br>&nbsp; &nbsp; tm_mday: Integer;<br>&nbsp; &nbsp; tm_mon: Integer;<br>&nbsp; &nbsp; tm_year: Integer;<br>&nbsp; &nbsp; tm_wday: Integer;<br>&nbsp; &nbsp; tm_yday: Integer;<br>&nbsp; &nbsp; tm_isdst: Integer;<br>&nbsp; end;<br>&nbsp; ptm = ^tm;<br><br>time_t=longint;<br>ptime_t=^time_t;<br>//有了结构还不可以转换吗
 
后退
顶部