Hallo zusammen,
ich spiele gerade etwas mit LongFormatString herum. Ziel soll es sein eine Wettkampfauswertung zu erzeugen. Da man dort ja meist nur Minuten, Sekunden und Millisekunden braucht, muss dafür etwas getan werden, damit man das auch bekommt.
Für mein grundsätzliches Verständnis wollte ich eine kleine Versuchsreihe machen und hab dabei ein komisches Verhalten bemerkt.
Mein Sourcecode sieht wie folgt aus:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24:
| procedure THauptfenster.Button16Click(Sender: TObject); var temp: string; timetemp: TDateTime; begin temp :=FormatSettings.LongTimeFormat; timetemp := 0.00265987; self.Memo1.Lines.Add(FormatSettings.LongTimeFormat); self.Memo1.Lines.Add(TimeToStr(timetemp));
FormatSettings.LongTimeFormat := 'mm:ss.z'; self.Memo1.Lines.Add(FormatSettings.LongTimeFormat); self.Memo1.Lines.Add(TimeToStr(timetemp));
FormatSettings.LongTimeFormat := 'hh:mm:ss.z'; self.Memo1.Lines.Add(FormatSettings.LongTimeFormat); self.Memo1.Lines.Add(TimeToStr(timetemp));
FormatSettings.LongTimeFormat := 'ss.z'; self.Memo1.Lines.Add(FormatSettings.LongTimeFormat); self.Memo1.Lines.Add(TimeToStr(timetemp));
FormatSettings.LongTimeFormat := temp; end; |
Also nur eine Zeit in verschiedenen Formaten ausgeben. Das Ergebnis sieht aber so aus:
Quelltext
1: 2: 3: 4: 5: 6: 7: 8:
| hh:mm:ss 00:03:49 mm:ss.z 12:49.813 hh:mm:ss.z 00:03:49.813 ss.z 49.813 |
Kann mir jemand erklären wo die markierte 12 herkommt? Eigentlich sollte da ja auch '03' stehen?!?!
Gruß,
Jack
Es gibt keine dummen Fragen, nur dumme Antworten.