procedure TForm1.Button1Click(Sender: TObject);
var
settings: TFormatSettings;
dt: TDateTime;
begin
GetLocaleFormatSettings(GetUserDefaultLCID, settings);
settings.DateSeparator := '/';
settings.TimeSeparator := ':';
settings.ShortDateFormat := 'yyyy/mm/dd';
settings.ShortTimeFormat := 'hh:nn:ss';
dt:= strToDateTime('2010/3/19 08:09:10',settings);
DateTimePicker1.DateTime :=dt;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
DateTimePicker2.DateTime := strToDateTime('2010/3/19 08:09:10');
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
edit2.Text:=floattostr( strToDateTime('2010-3-19 08:10:10') - strToDateTime('2010-3-19 08:09:10'));
edit3.Text:=floattostr( strToTime('08:10:10') - strToTime('08:09:10'));
edit4.Text:=floattostr( strToTime('00:01:00'));
end;
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。