programmerdelphi2k 237 Posted April 19, 2023 I dont know if help you, I did some test using "FormatSettings" creating and some countries. and was possible use anothers chars and get all milliseconds as expected procedure TForm1.Button1Click(Sender: TObject); var LocalName: string; FS : TFormatSettings; LChar : char; LDateStr : string; begin LocalName := ListBox1.Items[ListBox1.ItemIndex]; // FS := TFormatSettings.Create(LocalName); // Memo1.Text := 'Before: [' + FS.DecimalSeparator + ']'; Memo1.Lines.Add('Before: [' + FS.ShortDateFormat + ']'); Memo1.Lines.Add('Before: [' + FS.LongTimeFormat + ']'); // LChar := ListBox2.Items[ListBox2.ItemIndex][1]; // , . ! @ * $ & ... // FS.LongTimeFormat := format('hh:nn:ss%szzz', [LChar]); // Memo1.Lines.Add('After: [' + FS.DecimalSeparator + ']'); Memo1.Lines.Add('After: [' + FS.ShortDateFormat + ']'); Memo1.Lines.Add('After: [' + FS.LongTimeFormat + ']'); // if LocalName.Contains('de-DE') or LocalName.Contains('ru-RU') or LocalName.Contains('be-BE') then LDateStr := '19.04.2023' + ' 11:59:10,238' // '.' = 11:59:00!000 else if LocalName.Contains('zh-CN') then LDateStr := '2023/04/19' + ' 11:59:10.238' // comma = Error else if LocalName.Contains('fr-FR') or LocalName.Contains('pt-BR') then LDateStr := '19/04/2023' + ' 11:59:10,238' // "point" = FR 11:59:00.000 / BR "point" = Error else LDateStr := '04/19/2023' + ' 11:59:10.238'; // comma = Error // Memo1.Lines.Add(StrToDateTime(LDateStr, FS).ToString(FS)); end; Share this post Link to post
Attila Kovacs 629 Posted April 19, 2023 1 hour ago, programmerdelphi2k said: I dont know if help you, I did some test using "FormatSettings" creating and some countries. and was possible use anothers chars and get all milliseconds as expected Not really. I can't modify the DAC source, neither do I want to. 😕 Share this post Link to post
programmerdelphi2k 237 Posted April 19, 2023 (edited) just not possible verify the date and convert to format expected in each Country-Format, or use a universal format like ISO, before any works? Edited April 19, 2023 by programmerdelphi2k Share this post Link to post
Attila Kovacs 629 Posted April 19, 2023 3 minutes ago, programmerdelphi2k said: just not possible verify the date and convert to format expected in each Country-Format, or use a universal format like UTC, before any works? I'm sure we could find a workaround but why not just fix Delphi? Share this post Link to post