Skip to main content

Green hexagon with a white calendar and clock in the middle. Datum/Uhrzeit-Tool

One-Tool-Beispiel

Für das Datum/Uhrzeit-Tool gibt es ein One-Tool-Beispiel. Unter Beispiel-Workflows erfahren Sie, wie Sie dieses und viele weitere Beispiele direkt in Alteryx Designer aufrufen können.

Verwenden Sie das Datum/Uhrzeit-Tool, um Datum/Uhrzeit-Daten in eine Vielzahl von Formaten umzuwandeln, darunter sowohl ausdruckfreundliche als auch menschenlesbare Formate. Sie können auch die Sprache Ihrer Datum/Uhrzeit-Daten bestimmen. Bei der Beförderung von Arbeitsgängen mit 2 Daten unterschiedlicher Genauigkeit von Datum und Uhrzeit ist die höhere Präzision ausschlaggebend. Um genauere Datums-/Uhrzeitformate als Strings zu formatieren, müssen Sie ein Datenfelder-Auswahl-Tool einfügen , bevor Sie in eine Datenbank schreiben.

Tool-Konfiguration

Verbinden Sie eine Datenquelle mit dem Eingabeanker des Datum/Uhrzeit  -Tools. Wählen Sie im Konfigurationsfenster das Format aus, das konvertiert werden soll. Es gibt zwei Optionen:

  1. Datum-/Uhrzeitformat in Zeichenfolge : Konvertiert das Datum-/Uhrzeitformat in eine Zeichenfolge.

    • Wählen Sie das zu konvertierende Datum-/Uhrzeitfeld aus : Klicken Sie auf die Dropdown-Liste, um ein Datum-/Uhrzeitfeld (Spalte) zu wählen. Wenn keine Datum/Uhrzeit-Spalten verfügbar sind, erscheint das Feld abgeblendet und die Meldung Keine passenden Eingabefelder verfügbar wird angezeigt.

    • Legen Sie den neuen Spaltennamen fest : Geben Sie einen neuen Spaltennamen ein, oder verwenden Sie die Standardoption DateTime_Out .

    • Geben Sie die Sprache für Datum/Uhrzeit an : Wählen Sie die Dropdown-Liste, um die Sprache für Ihre neue Ausgabe der Zeichenfolgespalte zu wählen. Eine Liste der Formate nach Sprache finden Sie unten im Abschnitt  Sprache für Datum/Uhrzeit festlegen .

    • Wählen Sie das Format für die neue Spalte aus : Wählen Sie für Ihre neue Spalte ein Format aus der Liste aus, oder wählen Sie Benutzerdefiniert , um im Feld Benutzerdefiniertes Format für die neue Spalte festlegen Ihr eigenes Format zu erstellen. Weitere Informationen finden Sie folgend im Abschnitt Benutzerdefiniertes Format .

  2. Zeichenfolge in Datum-/Uhrzeitformat : Konvertiert Zeichenfolgedaten in ein Datum-/Uhrzeitformat.

    • Wählen Sie das zu konvertierende Zeichenfolgenfeld aus : Klicken Sie auf die Dropdown-Liste, um ein Zeichenfolgenfeld (Spalte) zu wählen, das in ein Datum-/Uhrzeitformat konvertiert werden soll. Wenn keine Datum/Uhrzeit-Spalten verfügbar sind, erscheint das Feld abgeblendet und die Meldung Keine passenden Eingabefelder verfügbar wird angezeigt.

    • Legen Sie den neuen Spaltennamen fest : Geben Sie einen neuen Spaltennamen ein, oder verwenden Sie die Standardoption DateTime_Out .

    • Geben Sie die Sprache für Datum/Uhrzeit an : Wählen Sie die Dropdown-Liste, um die Sprache der eingehenden Zeichenfolgendaten zu ermitteln. Eine Liste der Formate nach Sprache finden Sie unten im Abschnitt  Sprache für Datum/Uhrzeit festlegen .

    • Wählen Sie das Format aus, das mit dem eingehenden Zeichenfolgenfeld übereinstimmt : Wählen Sie ein Format aus der Liste aus, oder wählen Sie Benutzerdefiniert , um im Abschnitt Legen Sie das Format des eingehenden Zeichenfolgenfelds fest ein anderes Format zu ermitteln. Weitere Informationen finden Sie folgend im Abschnitt Benutzerdefiniertes Format .

Benutzerdefiniertes Format

Sie können ein benutzerdefiniertes Format festlegen, das entweder Ihrem eingehenden Zeichenfolgenfeld oder dem neu erstellten Zeichenfolgenfeld entspricht.

  1. Wählen Sie Benutzerdefiniert aus, um ein eigenes Format anzugeben. Designer zeigt ein Beispiel an, das auf dem Format basiert, das Sie eingeben.

  2. Verwenden Sie die Angaben und Trennzeichen wie unter Formate beschrieben (Beispiel: dd, MM, yyyy) oder die Angaben und Trennzeichen, die von den Datum/Uhrzeit -Funktionen DateTimeParse und DateTimeFormat unterstützt werden (Beispiel: %d, %m, %Y).

    Warnung

    You cannot mix the pattern style formatting with the percent style formatting when using the Custom format option of the DateTime tool.

    For example, if you currently have a DateTime tool that converts a string to date/time format using this custom format: %B dd %Y (using both pattern-style and percent-style formatting), you will need to update it to either: Month dd yyyy (or similar) or %B %d %Y (or similar). Note that each of these use one of pattern-style or percent-style formatting, rather than a mix of both.

Sie können ein Sternchen ( * ) als Platzhalterzeichen verwenden, um ein beliebiges Zeichen im Datumsformatfeld zu ersetzen.

  • d : Tag des Monats als Ziffern ohne führende Nullen für einstellige Tage.

  • day : Der vollständige Name des Wochentags.

  • dd : Tag als 2 Ziffern, mit führenden Nullen für einstellige Tage. Bei der Eingabe sind führende Nullen optional.

  • dy: : Wochentag als Abkürzung mit 3 Buchstaben. Bei der Eingabe werden vollständige Bezeichnungen akzeptiert, doch Alteryx überprüft nicht, ob der Wochentag mit dem restlichen Datum übereinstimmt.

  • EEEE : Der vollständige Name des Wochentags.

  • M : Einstelliger Monat ohne führende Null.

  • MM : Monat als Ziffern mit führenden Nullen für einstellige Monate. Bei der Eingabe sind führende Nullen optional.

  • MMM : Der abgekürzte Name des Monats.

  • MMMM : Der vollständige Name des Monats.

  • Mon : Bezeichnung des Monats als Abkürzung mit 3 Buchstaben. Bei der Eingabe werden vollständige Bezeichnungen ebenfalls akzeptiert.

  • Month : Name des Monats. Bei der Eingabe werden Abkürzungen ebenfalls akzeptiert.

  • yy : Das Jahr nur durch die letzten beiden Ziffern dargestellt. Bei der Konvertierung von einer Zeichenfolge werden zweistellige Jahre in den Bereich vom aktuellen Jahr minus 66 Jahre bis zum aktuellen Jahr plus 33 Jahre zugeordnet. Beispielsweise wird 2016 ein zweistelliges Jahr im Bereich von 1950 bis 2049 zugeordnet. Bei der Eingabe werden vier Ziffern ebenfalls akzeptiert.

  • yyyy : Jahr vollständig mit 4 Ziffern dargestellt. Bei der Eingabe werden 2 Ziffern ebenfalls akzeptiert und so zugeordnet wie bei der yy-Angabe.

    Limitation with 6-Digit Dates

    Because up to 4 digits are read for the year, formats that are intended to have only 2 digits without a separator, such as a 6-digit date stamp (for example, %y%m%d for data resembling 170522 for May 22, 2017), are still read as 4 digits. To work around this limitation, you can...

    • Depending on your range of dates, use four digits for the year (for example, 2017 instead of 17).

    • Use the RegEx tool to insert a space after the first 2 digits in the string.

  • ahh : AM/PM (nur vereinfachtes Chinesisch).

  • H : Stunden ohne führende Nullen für einstellige Stunden (24-Stunden-Format).

  • HH oder hh : Stunden mit führenden Nullen für einstellige Stunden (24-Stunden-Format).

  • mm : Minuten mit führenden Nullen für einstellige Minuten.

  • ss : Sekunden mit führenden Nullen für einstellige Sekunden.

  • ffff : Genauigkeit, die Anzahl der 'f'-Zeichen bedeutet die Anzahl der Ziffern, die für Teilsekunden verwendet werden sollen (Beispiel: fff für Millisekunden, ffffff für Mikrosekunden usw.).

Bei der Ausgabe werden Trennzeichen im Datum-/Uhrzeitformat exakt verwendet. Bei der Eingabe:

  • - und / werden als gleichbedeutend betrachtet

  • werden Leerzeichen ignoriert.

  • : und , müssen exakt übereinstimmen.

Specify Your DateTime Language

  • Date/Time Format to String: When you convert date-time data to string data, use the Specify your DateTime Language dropdown to choose the language for your new string column output. Depending on the language, different format options are available.

  • String to Date/Time Format: When you convert string data to date-time data, use the Specify your DateTime Language dropdown to identify the language of the incoming string data. Depending on the language, different format options are available.

English

Date/Time Format to String

String to Date/Time Format

day, dd Month, yyyy

yyyy-MM-dd hh:mm:ss

dd-MM-yy

MM/dd/yyyy hh:mm:ss

dd-MM-yyyy

MM/dd/yy hh:mm:ss

dd-Mon,-yy

dd/MM/yyyy hh:mm:ss

dd Month, yyyy

dd/MM/yy hh:mm:ss

dd/MM/yy

day, dd Month, yyyy

dd/MM/yyyy

dd-MM-yy

dy., Month dd, yyyy

dd-MM-yyyy

MM-dd-yy

dd-Mon.-yy

MM-dd-yyyy

dd Month, yyyy

MM/dd/yy

dd/MM/yy

MM/dd/yyyy

dd/MM/yyyy

Mon dd

dy., Month dd, yyyy

Month dd, yyyy

MM-dd-yy

Month, yyyy

MM-dd-yyyy

yyyy-MM-dd

MM/dd/yy

yyyyMMdd

MM/dd/yyyy

yyyy/MM/dd

Month dd, yyyy

yyyy-MM-dd hh:mm:ss

Month, yyyy

MM/dd/yyyy hh:mm:ss

yyyy-MM-dd

dd/MM/yyyy hh:mm:ss

yyyyMMdd

Custom

yyyy/MM/dd

HH:mm:ss

Custom

简体中文 (Simplified Chinese)

Date/Time Format to String

String to Date/Time Format

yyyy'年'M'月'd'日'

yyyy'年'M'月'd'日' ahh'时'mm'分'ss'秒'

yyyy'年'M'月'd'日'day

yyyy-MM-dd hh:mm:ss

yyyy-MM-dd

yyyy'年'M'月'd'日'

yyyyMMdd

yyyy'年'M'月'd'日'day

yyyy/MM/dd

yyyy-MM-dd

yyyy'年'M'月'd'日' ahh'时'mm'分'ss'秒'

yyyyMMdd

yyyy-MM-dd hh:mm:ss

yyyy/MM/dd

HH:mm:ss

Custom

Français (French)

Date/Time Format to String

String to Date/Time Format

d Mon yy

d Mon yy HH:mm:ss

d Month yyyy

yyyy-MM-dd hh:mm:ss

day d Month yyyy

dd/MM/yyyy hh:mm:ss

dd-MM-yy

dd/MM/yy hh:mm:ss

dd-MM-yyyy

d Mon yy

dd/MM/yy

d Month yyyy

dd/MM/yyyy

day d Month yyyy

yyyyMMdd

dd-MM-yy

yyyy/MM/dd

dd-MM-yyyy

d Mon yy HH:mm:ss

dd/MM/yy

yyyy-MM-dd hh:mm:ss

dd/MM/yyyy

dd/MM/yyyy hh:mm:ss

yyyy-MM-dd

dd/MM/yy hh:mm:ss

yyyyMMdd

Custom

yyyy/MM/dd

HH:mm:ss

Custom

Deutsch (German)

Date/Time Format to String

String to Date/Time Format

dd.MM.yy

dd.MM.yy HH:mm

dd.MM.yyyy

dd.MM.yyyy HH:mm:ss

d. Month yyyy

yyyy-MM-dd hh:mm:ss

day, dd. Month yyyy

dd/MM/yyyy hh:mm:ss

day d. Month yyyy

dd/MM/yy hh:mm:ss

dd-MM-yy

dd.MM.yy

dd-MM-yyyy

dd.MM.yyyy

dd/MM/yy

d. Month yyyy

dd/MM/yyyy

day, dd. Month yyyy

yyyy-MM-dd

day, d. Month yyyy

yyyyMMdd

dd-MM-yy

yyyy/MM/dd

dd-MM-yyyy

dd.MM.yy HH:mm

dd/MM/yy

dd.MM.yyyy HH:mm:ss

dd/MM/yyyy

yyyy-MM-dd hh:mm:ss

yyyy-MM-dd

dd/MM/yyyy hh:mm:ss

yyyyMMdd

dd/MM/yy hh:mm:ss

yyyy/MM/dd

Custom

HH:mm:ss

Custom

Italiano (Italian)

Date/Time Format to String

String to Date/Time Format

dd/Mon/yy

dd/Mon/yy HH:mm:ss

dd Month yyyy

yyyy-MM-dd hh:mm:ss

day d Month yyyy

dd/MM/yyyy hh:mm:ss

dd-MM-yy

dd/MM/yy hh:mm:ss

dd-MM-yyyy

dd/Mon/yy

dd/MM/yy

dd Month yyyy

dd/MM/yyyy

day d Month yyyy

yyyy-MM-dd

dd-MM-yy

yyyyMMdd

dd-MM-yyyy

yyyy/MM/dd

dd/MM/yy

dd/Mon/yy HH:mm:ss

dd/MM/yyyy

yyyy-MM-dd hh:mm:ss

yyyy-MM-dd

dd/MM/yyyy hh:mm:ss

yyyyMMdd

dd/MM/yy hh:mm:ss

yyyy/MM/dd

Custom

HH:mm:ss

Custom

日本語 (Japanese)

Date/Time Format to String

String to Date/Time Format

yyyy'年'M'月'd'日'day

yyyy-MM-dd hh:mm:ss

yyyy'年'M'月'd'日'

yyyy'年'M'月'd'日'day

M'月'd'日'

yyyy'年'M'月'd'日'

yyyy-MM-dd

M'月'd'日'

yyyyMMdd

yyyy-MM-dd

yyyy/MM/dd

yyyyMMdd

yyyy-MM-dd hh:mm:ss

yyyy/MM/dd

Custom

hh'時'mm'分'ss'秒'

HH:mm:ss

Custom

Português (Portuguese)

Date/Time Format to String

String to Date/Time Format

d' de 'Month' de 'yyyy

yyyyMMdd H.mm

day, d' de 'Month' de 'yyyy

yyyy-MM-dd hh:mm:ss

dd-MM-yy

dd/MM/yyyy hh:mm:ss

dd-MM-yyyy

dd/MM/yy hh:mm:ss

dd/MM/yy

d' de 'Month' de 'yyyy

dd/MM/yyyy

day, d' de 'Month' de 'yyyy

yyyy-MM-dd

dd-MM-yy

yyyyMMdd

dd-MM-yyyy

yyyy/MM/dd

dd/MM/yy

yyyyMMdd H.mm

dd/MM/yyyy

yyyy-MM-dd hh:mm:ss

yyyy-MM-dd

dd/MM/yyyy hh:mm:ss

yyyyMMdd

dd/MM/yy hh:mm:ss

yyyy/MM/dd

Custom

HH:mm:ss

Custom

Español (Spanish)

Date/Time Format to String

String to Date/Time Format

d' de 'Month' de 'yyyy

yyyyMMdd H.mm

day d' de 'Month' de 'yyyy

yyyy-MM-dd hh:mm:ss

dd-MM-yy

dd/MM/yyyy hh:mm:ss

dd-MM-yyyy

dd/MM/yy hh:mm:ss

dd/MM/yy

d' de 'Month' de 'yyyy

dd/MM/yyyy

day d' de 'Month' de 'yyyy

yyyyMMdd

dd-MM-yy

yyyy/MM/dd

dd-MM-yyyy

yyyyMMdd H.mm

dd/MM/yy

yyyy-MM-dd hh:mm:ss

dd/MM/yyyy

dd/MM/yyyy hh:mm:ss

yyyy-MM-dd

dd/MM/yy hh:mm:ss

yyyyMMdd

Custom

yyyy/MM/dd

HH:mm:ss

Custom