I populate a TStringList under Delphi 7 with the return values of that function :
function dateTime2str(td : TDateTime) : string;
var
iformatsettings : tformatsettings;
begin
GetLocaleFormatSettings(LOCALE_USER_DEFAULT, iformatsettings);
result := DateTimeToStr(td, iFormatSettings);
end;
Then I read each values of the TStringList with that function :
function str2DateTime(s : string) : TDateTime;
var
iformatsettings : tformatsettings;
begin
GetLocaleFormatSettings(LOCALE_USER_DEFAULT, iformatsettings);
result := strtodatetime(s,iFormatSettings);
end;
but it triggers an EConvertError exception : '6/7/12 3:02:31 AM' is not a valid date and time.
Why ?
Many thanks