之前C語言用的Time函式Delphi有如函式可以讀取?? |
答題得分者是:amide
|
GeminiLin
一般會員 發表:12 回覆:24 積分:12 註冊:2002-12-26 發送簡訊給我 |
|
william
版主 發表:66 回覆:2535 積分:3048 註冊:2002-07-11 發送簡訊給我 |
|
GeminiLin
一般會員 發表:12 回覆:24 積分:12 註冊:2002-12-26 發送簡訊給我 |
|
william
版主 發表:66 回覆:2535 積分:3048 註冊:2002-07-11 發送簡訊給我 |
引言: 這些函數都查過了... TDateTime是Double Type所使用的方法是小數點之前是日期,之後是時間,而C的Time函數是Longword的方式做的,從格林威治1970年1月1日00:00:00以秒計算,是否只能土法煉鋼自行轉換,而無法直接使用函數轉換?< >< > 還有一個問題,讀到一組String是'3E0193FF',要如何轉換為Double Type?謝謝!>>< face="Verdana, Arial, Helvetica"> Oh~~~ so you're using time_t record type? I think '3E0193FF' should be converted to a longint 1040290815? I am sorry there is no built-in function to convert a hex number to dec and you probably need to write it yourself. BTW, using this kind of time representation... could it be the year 2048 problem (similar to y2k but 2048 for this time_t record in some C compilers)? For example, to add some second 1000 seconds to datetime variable ADateTime: ADateTime := ADateTime EncodeTime(1000 div 3600, 1000 div 60, 1000 mod 60,0); |
william
版主 發表:66 回覆:2535 積分:3048 註冊:2002-07-11 發送簡訊給我 |
|
amide
一般會員 發表:4 回覆:13 積分:13 註冊:2002-07-11 發送簡訊給我 |
|
Miles
尊榮會員 發表:27 回覆:662 積分:622 註冊:2002-07-12 發送簡訊給我 |
GeminiLin兄您好:
1.目前小弟還沒找到函式, 但這可能要先用土法煉鋼的方法做 2.要注意Integer的最大值到多少, 下面的值測試無誤
Integer值最大到十進位的2147483647 十六進位的$7FFFFFFF
procedure TForm1.Button1Click(Sender: TObject); begin ShowMessage(IntToHex(1040290815,8)); ShowMessage(IntToStr(StrToInt('$3E0193FF'))); end;我不是高手, 高手是正在銀幕前微笑的人.
------
我不是高手, 高手是正在銀幕前微笑的人. |
GeminiLin
一般會員 發表:12 回覆:24 積分:12 註冊:2002-12-26 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |