下面日期時間有沒有相關的函式? ( 积分: 100 )

J

jokedj

Unregistered / Unconfirmed
GUEST, unregistred user!
下面日期時間有沒有相關的函式?
Following are some examples of TDateTime values and their corresponding dates and times:
0 12/30/1899 12:00 am
2.75 1/1/1900 6:00 pm
-1.25 12/29/1899 6:00 am
35065 1/1/1996 12:00 am
 
var
S:String;
begin
S := FormatDateTime('yyyy-mm-dd hh:mm:ss AM/PM', 2.75);
showmessage(s);
end;
使用FormatDateTime即可
 
2楼正确。
反过来可以:
var
S:String;
begin
S := format('%f',[StrToDateTime('1900-1-1 6:0:0 PM')]);
showmessage(s);
end;
 

Similar threads

S
回复
0
查看
949
SUNSTONE的Delphi笔记
S
S
回复
0
查看
770
SUNSTONE的Delphi笔记
S
I
回复
0
查看
817
import
I
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
顶部