Announcement

Collapse
No announcement yet.

format time date

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • format time date

    hi,

    ich brauche das folgende format.

    zeit := hhmmss ; z.B.: 143012 ohne ":"
    datum := ttmmjjjj ; z.B.: 01022003 ohne ":"

    wie kann ich das anstellen?

    gruß

    lehrling

  • #2
    das geht z.B. so:
    <pre>
    procedure DelColon
    var S: string;
    begin
    S := '14:30:12';
    while Pos(':', S) > 0 do
    Delete(S, Pos(':', S), 1);
    end;
    </pre>

    Gruss
    Uw

    Comment


    • #3
      ...oder die Variablen <i>ShortDateFormat</i> bzw. <i>ShortTimeFormat</i> im Programm setzen, z.B. <br>
      <pre>ShortDateFormat := 'ddmmyyyy'; // anstatt 'dd.mm.yyyy';</pre>
      Viele Grüße Hans-Pete

      Comment


      • #4
        FormatDateTime('ddmmyyyy',now); // Delphi 6<p>
        Das hat den Vorteil, dass Du die Einstellungen von ShortDateformat nicht sichern und wiederherstellen musst.<p>
        Schöne Grüße, Mario Noac
        Schöne Grüße, Mario

        Comment

        Working...
        X