Follow the example below to understand how to rearrange the format of a date.
Let's take the example of a DATE field in your catalogue, organized as follows: 05/05/2024 (that is, DD/MM/YYYY).
To change this date for a catalogue, for all related channels: use catalogue optimization.
- The date in the following format is necessary: DD-MM-YYYY.
Use catalogue optimizations to easily transform your data.
Go to: "Catalogue"<"Optimizations"<"Start optimizing your catalogue".
To modify and replace the “DATE” field.
1. Select the “Use an existing field” option, which will replace the existing content with the one you will determine in the next step.
2. Choose the catalogue field containing the date you want to modify.
3. Transform the data, using the SPLIT function.
This function is used to isolate a part of an existing content, based on a dedicated reference character(s), here: “/“.
So if I have the value: DD-MM-YYYY
- SPLIT(DATE,/,1) means that I want the content before (1) the reference character “/“ : 05
- SPLIT(DATE,/,2) means that I want the second content (2) after the reference character “/“ : 05
- SPLIT(DATE,/,3) means that I want the third content (3) after the reference character “/“ : 2024
4. Link all the results with the new desired value, that is, "-".
The result appears as follows.
To keep the “DATE” field and create a new “NEW DATE” field.
1. Only the first step changes here. So, choose the second option available on the right of the screen.
2. Define the content, using the steps described above.
By doing this, you keep the catalogue field "DATE" with the separator "/", and create a new field "NEW_DATE" with the new format.
To change the date of a catalogue, for a dedicated channel: Use the SPLIT function in a rule.
To change the value directly in the flow of a channel, this SPLIT function can again be used in a rule.
- Example with Google's requirements for the “” attribute
As Google requires a specific format for this attribute, you may not have the right one in your catalogue.
Here is the format requirement: YYYY-MM-DDThh:mm[±hhmm]
Here is an example of the value that could be accepted: 2024-05-17T00:00+0200
Use the SPLIT function to add a new separator and even add text to insert specifications on the time and time zone.
This formula structures the content as follows.