Skip to main content
Skip table of contents

convertDateTime

Typ


Versionshinweise

11.2

Web Client(Haken)

Code

GROOVY
String DateUtils.convertDateTime(Date date, int dateStyle, int timeStyle)

Formatiert Datum und Zeit anhand der übergebenen Formate.

Parameter

  • date - Der Datumswert für die Konvertierung
  • dateStyle - Die Formatierung für das Datum.
    Mögliche Werte:
    • DateUtils.FORMAT_SHORT besteht komplett aus Zahlen und die Jahreszahl hat nur 2 Stellen, wie zum Beispiel 12.13.52
    • DateUtils.FORMAT_MEDIUM ist länger, wie zum Beispiel 07.03.2011
    • DateUtils.FORMAT_LONG ist noch länger, wie zum Beispiel 7. März 2011
    • DateUtils.FORMAT_FULL ist fast komplett angegeben, wie zum Beispiel Montag, 7. März 2011
  • timeStyle - Die Formatierung für die Uhrzeit.
    Mögliche Werte:
    • DateUtils.FORMAT_SHORT besteht komplett aus Zahlen und zeigt keine Sekunden, wie zum Beispiel 13:30
    • DateUtils.FORMAT_MEDIUM ist länger, wie zum Beispiel 14:45:34
    • DateUtils.FORMAT_LONG ist noch länger, wie zum Beispiel 14:41:07 MEZ
    • DateUtils.FORMAT_FULL ist fast komplett angegeben, wie zum Beispiel 14:46 Uhr MEZ.

Rückgabe

Gibt Datum und Uhrzeit als Text formatiert zurück.

Beispiele+

GROOVY
String dateTime = DateUtils.convertDateTime(new Date(0), DateUtils.FORMAT_SHORT, DateUtils.FORMAT_SHORT);
//=>"12.13.52 13:30"
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.