Rule: Convert Date and Time Format#

The rule converts the value of a selected element from one date and time format to another. It is useful when a target channel requires a different date format than the one in your feed, for example a Unix timestamp in reviews for Google Product Reviews. You do not need to modify the source data at all.

You can find the rule in the Number or price settings section, both in the classic form and in Canvas.

Extra features#

  • Predefined formats for the most common date and time notations
  • Custom format built from placeholder characters (tokens)
  • Multiple dates in one value, for example a range with a start and end date
  • Values that do not match the selected format are left unchanged and flagged in the rule application history

Formats#

Format Description
YYYY-MM-DD Year-Month-Day (ISO 8601 standard)
YYYY-MM-DDTHH:mmZ Google format, UTC
YYYY-MM-DDTHH:mm:ss Date and time with “T” separator (e.g. 2025-06-24T12:46:12)
YYYY/MM/DD Year/Month/Day with slashes
DD/MM/YYYY Day/Month/Year (European format)
MM/DD/YYYY Month/Day/Year (American format)
YYYYMMDD Compact format without separators
DD.MM.YYYY Day.Month.Year
X Unix timestamp (number of seconds since 1 Jan 1970)
Custom format You define the format yourself

Custom format#

After selecting Custom format, a text field appears where you write the format using these tokens:

Token Meaning
YYYY Year, four digits
YY Year, two digits
MM Month, two digits (01 to 12)
M Month without leading zero
DD Day, two digits
D Day without leading zero
HH Hour, two digits
H Hour without leading zero
mm Minute, two digits
ss Second, two digits
X Unix timestamp (only standalone, without other tokens)
  • Tokens are case-sensitive: MM is month, mm is minute.
  • Between tokens you can only use the characters - . / :, a space, T, and Z.
  • A format with any other character, without a token, or left empty cannot be saved — the field will display an error. The form will also reject leading or trailing spaces in the format.
  • One value can contain multiple dates, for example DD.MM.YYYY - DD.MM.YYYY. A new block starts where a token would repeat. Blocks must be separated by at least one character, and Format to must have the same number of blocks as Format from. Separators may differ between the two formats.

How the conversion works#

  • The conversion runs in UTC. The rule does not convert between time zones.
  • If Format from does not include time and Format to does, 00:00:00 is added. In the opposite case, the time is discarded.
  • Leading and trailing spaces and line breaks in the value are trimmed before conversion.
  • The value must match Format from fully and exactly, including separators and spaces.
  • A value that does not match the format (different format, time zone written as an offset, non-existent date such as 2025-02-30, different number of date blocks) is left unchanged. A warning is recorded for the product and the rule continues with the remaining products.
  • Unix timestamp is read only as a whole positive integer in seconds.
  • An empty element value stays empty, without a warning.

Specific examples#

Example 1: Unix timestamp to Google Product Reviews format#

The source feed has the review date as a Unix timestamp 1725172732, but Google Product Reviews requires the format 2024-09-01T06:38:52Z.

  1. Open the Rules page and click New rule.
  2. In the Rule type field select Convert Date and Time Format.
  3. In the Queries field choose All products, or a custom product query.
  4. In the Element field select the element containing the review date.
  5. In the Format from field choose X (Unix timestamp).
  6. In the Format to field choose Custom format and enter YYYY-MM-DDTHH:mm:ssZ.
  7. Name the rule, for example Review date to Google format.

Example 2: Delivery date from DD.MM.YYYY to YYYY-MM-DD#

A supplier sends the delivery date in the element DELIVERY_DATE as 15.11.2026, but the target channel requires the international format 2026-11-15.

  1. Open the Rules page and click New rule.
  2. In the Rule type field select Convert Date and Time Format.
  3. In the Queries field choose All products.
  4. In the Element field select DELIVERY_DATE.
  5. In Format from choose DD.MM.YYYY, in Format to choose YYYY-MM-DD.
  6. Name the rule, for example Delivery date to ISO format.

FAQ#

What is the Convert Date and Time Format rule for?#

It converts the value of an element from one date and time format to another, for example a delivery date from DD.MM.YYYY to YYYY-MM-DD or a Unix timestamp to a Google format. You do not need to modify the source data.

What is the difference from the Add Days to Date rule?#

The Add Days to Date rule writes today’s date shifted by a specified number of days. Convert Date and Time Format does not add anything — it only changes the notation of the value already present in the element.

What happens if a value does not match the selected Format from?#

The value is left unchanged. A warning is recorded for the product and the rule continues with the remaining products. You can find the warnings in the rule application history, which shows which value and which element do not match the format, with a link to the rule.

What happens to an empty value?#

An empty value stays empty, without a warning.

Does the rule convert time zones?#

No. The conversion runs in UTC. Values with a time zone written as an offset do not match the format and are left unchanged.

Does the rule detect the value format automatically?#

No. You must select Format from yourself, and the value must match it fully and exactly.

Does the rule support milliseconds, AM/PM, or month and day names?#

No. The rule works with the tokens listed in the Custom format table.

Can a single value contain multiple dates?#

Yes. For example, you can convert the value 01.11.2026 - 15.11.2026 using the format from DD.MM.YYYY - DD.MM.YYYY to YYYY-MM-DD - YYYY-MM-DD. Both formats must have the same number of blocks.

Was this article helpful?