Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
PARSE_DATE
Wandelt Text in ein Datum um.
Verwendungsbeispiel
PARSE_DATE("%x", DateText)
Syntax
PARSE_DATE( format_string, text )
Parameter
format_string: Eine Stringdarstellung des Formats des Datumsfelds. Unter Elemente für Datums- und Uhrzeitangaben formatieren finden Sie eine Liste der Formatelemente, die von dieser Funktion unterstützt werden.
text: Eine Textdarstellung eines Datums.
Rückgabedatentyp
Datum
Beispiel
In diesen Beispielen ist DateText ein Feld mit einem Datum als Text. Verwenden Sie das Feld format_string, um das Format dieses Textstrings anzugeben. Wenn Sie PARSE_DATE auf das Textfeld anwenden, wird ein Datumswert zurückgegeben.
Example formula
Input
Output
PARSE_DATE("%m/%d/%y", DateText)
12/25/08
2008-12-25
PARSE_DATE("%d%m%Y", DateText)
25122008
2008-12-25
Hinweise
Beachten Sie bei Verwendung von PARSE_DATE Folgendes:
Nicht angegebene Felder: Jedes nicht angegebene Feld wird ab 01.01.1970 initialisiert.
Groß-/Kleinschreibung kann in Namen ignoriert werden. Bei Namen wie Monday, February usw. wird die Groß-/Kleinschreibung nicht berücksichtigt.
Leerraum: Ein oder mehrere aufeinanderfolgende Leerzeichen im Formatstring stimmen mit null oder mehreren aufeinanderfolgenden Leerzeichen im Datumsstring überein. Außerdem sind voran- und nachgestellte Leerzeichen im Datumsstring immer erlaubt – auch wenn sie nicht im Formatstring vorhanden sind.
Formatvorrang Wenn sich die Informationen von zwei (oder mehr) Formatelementen überschneiden und sich z. B. sowohl %F als auch %Y auf das Jahr beziehen, überschreibt das letzte Element in der Regel alle vorherigen.
Diese Funktion unterstützt Formatelemente, bietet aber keine vollständige Unterstützung für %Q, %a, %A, %g, %G, %j, %u, %U, %V, %w, and %W..
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-07-31 (UTC)."],[],[],null,["PARSE_DATE\n==========\n\nConverts text to a date.\n\nSample usage\n------------\n\n`PARSE_DATE(\"%x\", DateText)`\n\nSyntax\n------\n\n`PARSE_DATE( `\u003cvar translate=\"no\"\u003eformat_string\u003c/var\u003e`, `\u003cvar translate=\"no\"\u003etext\u003c/var\u003e` )`\n\n### Parameters\n\n\u003cvar translate=\"no\"\u003eformat_string\u003c/var\u003e - A string representation of the format of your date field. See [Format elements for date and time parts](/bigquery/docs/reference/standard-sql/format-elements#format_elements_date_time) for a list of format elements that this function supports.\n\n\u003cvar translate=\"no\"\u003etext\u003c/var\u003e - a text representation of a date.\n\nReturn data type\n----------------\n\nDate\n\nExample\n-------\n\nIn these examples, **DateText** is a field containing a text date. Use the *format_string* field to specify the format of that text string. Applying `PARSE_DATE` to the text field returns a Date value.\n\nNotes\n-----\n\nWhen using `PARSE_DATE`, keep the following in mind:\n\n- **Unspecified fields**. Any unspecified field is initialized from 1970-01-01.\n- **Case insensitive names**. Names, such as Monday, February, and so on, are case insensitive.\n- **Whitespace**. One or more consecutive white spaces in the format string matches zero or more consecutive white spaces in the date string. In addition, leading and trailing white spaces in the date string are always allowed -- even if they are not in the format string.\n- **Format precedence** . When two (or more) format elements have overlapping information (for example both `%F` and `%Y` affect the year), the last one generally overrides any earlier ones.\n\n\u003e This function supports format elements, but does not have full support for `%Q, %a, %A, %g, %G, %j, %u, %U, %V, %w, and %W.`\n\nRelated resources\n-----------------\n\n- [Dates and times](/looker/docs/studio/dates-and-times)\n- [Calculated fields](/looker/docs/studio/about-calculated-fields)\n- [Looker Studio function list](/looker/docs/studio/function-list)"]]