delphi中StrToDate和当前操作系统设定的日期格式有关,格式不一致时,会抛出错误。
最好在调用时,强制转换,如下

var
t:TDateTime;
fs:TFormatSettings;
begin
fs.ShortDateFormat:='yyyy-mm-dd';
fs.DateSeparator:='-';
t := StrToDate('2010-01-01',fs);

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-17
  • 2021-08-15
  • 2021-11-11
猜你喜欢
  • 2021-07-12
  • 2022-12-23
  • 2021-07-07
  • 2022-12-23
  • 2021-12-05
  • 2021-07-17
相关资源
相似解决方案