delphi中的strTodate,
delphi中StrToDate和当前操作系统设定的日期格式有关,格式不一致时,会抛出错误。
最好在调用时,强制转换,如下
var
t:TDateTime;
fs:TFormatSettings;
begin
fs.ShortDateFormat:='yyyy-mm-dd';
fs.DateSeparator:='-';
t := StrToDate('2010-01-01',fs);
- 上一篇 »delphi中的过程和函数
- 下一篇 »Delphi访问网页中的下拉菜单