function ConvertTime(AStr: string): TTime; var H, N, S: string; begin H := copy(Astr, 1, 4); N := copy(AStr, 6, 2); S := copy(AStr, 9, 2); Result := strtoTime(Format('%s%s%s', [H, N, S])); end;
u2m(UpToMe):你怎么每次都比我跑的快呀
function ConvertTime(AStr: string): TDateTime; var H, N, S: string; begin H := copy(Astr, 1, 4); N := copy(AStr, 6, 2); S := copy(AStr, 9, 2); Result := strtoTime(Format('%s%s%s', [H, N, S])); end;var ss:TDateTime; ss:=ConvertTime('2003- 5-10');
var
H, N, S: string;
begin
H := copy(Astr, 1, 4);
N := copy(AStr, 6, 2);
S := copy(AStr, 9, 2);
Result := strtoTime(Format('%s%s%s', [H, N, S]));
end;
var
H, N, S: string;
begin
H := copy(Astr, 1, 4);
N := copy(AStr, 6, 2);
S := copy(AStr, 9, 2);
Result := strtoTime(Format('%s%s%s', [H, N, S]));
end;var
ss:TDateTime;
ss:=ConvertTime('2003- 5-10');
如果需要的是string的话则
datetostr(datetimepicker.date);