Working with dates

Format date, Date difference and Shift date: write a date in your own format, count the days since or until a date, or move a date forward — and what time zones and Today's date mean for your ads.

Updated October 6, 2026

A date in a value comes from your product feed (a publish date, a sale end date) or from Today's date. Three steps work on it: Format date writes it in the date format you choose, Date difference counts the days between two dates (or hours, weeks, months…), and Shift date moves a date forward or back — the building blocks of a "published 12 days ago" line or a "sale ends in 3 days" countdown. You add them with "+ Add step" in any value editor: a placeholder in Studio, a channel field, a prompt input, or a catalog rule's Set field value.

If what you want is a label — "New", "Last chance" — rather than a date printed in the ad, compare the date in a rule instead. See Rules that depend on dates.

Format date#

Format date turns a date into text, written the way its Output pattern says. The pattern is built from letters:

LettersWritesExample
yyyythe year2026
MMthe month as two digits01
MMMthe short month nameJan
MMMMthe full month nameJanuary
ddthe day as two digits07
dthe day, no leading zero7
EEEthe short day nameWed
HHthe hour, 00–2314
mmthe minutes05
ssthe seconds09
XXXthe time zone offset+02:00

Dashes, dots, slashes, commas and spaces are written as they stand. Any letter is read as a date letter, so put words in single quotes: 'T' writes a literal T. Some common patterns:

PatternWrites
yyyy-MM-dd2026-01-31
dd.MM.yyyy31.01.2026
dd/MM/yyyy31/01/2026
MM/dd/yyyy01/31/2026
d MMMM yyyy31 January 2026
d MMM31 Jan
yyyy-MM-dd HH:mm2026-01-31 14:05
yyyy-MM-dd'T'HH:mm:ssXXX2026-01-31T14:05:09Z

The Common formats menu at the end of the Output pattern field writes any of these patterns into the field for you, and the line under the field shows what your pattern writes for a few sample dates.

Month and day names follow the catalog's language, so d MMMM writes "31 januari" for a Swedish catalog. A catalog with no language set writes the short English names, so MMMM there gives "Jan", not "January".

Time zone decides which clock the date is written in. Same as input keeps the date's own time zone; a date that carries no time zone is read as UTC. To convert, pick a region, such as Europe/Stockholm — a region follows its summer and winter time. Abbreviations like CET and fixed offsets like +02:00 aren't accepted as a Time zone; pick the region instead.

A date with no time of day — just a day, like 2026-08-06 — never changes day, whichever time zone you pick.

What a date step can read#

In a catalog, Format date, Date difference and Shift date read a column's text as a date when it is written as:

  • an ISO date, with or without a time — 2026-08-06, 2026-08-06T14:30:00+02:00
  • a compact date — 20260806
  • a day, month and year in your catalog's usual order, without a time — such as 26.08.2026
  • the pattern you gave the column, when its type is Date with a pattern on the Mapping tab.

A value in any other form makes the step come out empty for that product, so the value's fallback is used. One catch: the column's pattern only reaches the date step when the date step reads the column directly. If a text step comes before it — even Trim — the date step reads that step's text with the usual forms above instead.

Date difference#

Date difference counts from this date to the Other date — Today's date, or another field such as a sale start date — in the Unit you pick: minutes, hours, days, weeks, months or years. The count is negative when the other date is earlier, and it is always a whole number of units.

Days, weeks, months and years count calendar dates. A product published on 6 August is 0 days old all of 6 August, 59 days old all of 4 October, and 60 days old from midnight on 5 October — so "less than 60 days" is true for exactly 60 calendar days, including the day it was published. Time zone decides where each day starts, exactly as for Format date.

Hours and minutes are exact elapsed time, so Time zone has no effect on them; a date-time without an offset is read as UTC. The Time zone field is hidden for minutes and hours; a zone chosen earlier stays visible with the note "Has no effect for minutes and hours", so you can clear it.

If your feed's dates carry a time zone offset and you count days across a summer/winter time change, pick your region under Time zone, such as Europe/Stockholm, so both dates are counted as days in that region — or against Today's date: under Same as input a summer date (+02:00) counted against Today in winter turns over at 23:00 Stockholm time.

The result is a number, not a date. To calculate with it or write it nicely, add a Math or Format number step after it. The date you count to has to stay a date: give it no Format date step — format the result after the Date difference step instead.

Shift date#

Shift date moves the date by an Amount of the Unit you pick. In the Amount box, type a whole number — negative to move back, such as -7 — or pick a field from your feed instead. Thousands separators and units are not read, so type 1000, not 1 000; text that isn't a number isn't saved, and the box says so. A number with decimals, such as 2.5, isn't saved: the box says it isn't a whole number. It has no Time zone setting: the result keeps the date's own time zone.

At the end of a month, adding months lands on the last day of a shorter month: 31 January plus 1 month is 28 February (29 in a leap year). So Shift date and Date difference aren't always exact opposites — from 31 January to 28 February is 0 months, because a month counts only once the same day of the month is reached.

A shifted date is still a date, so you can add Format date after it to write it out.

Today's date#

Studio templates, channel fields and prompts can use Today's date. Catalogs can't — see Rules that depend on dates for why and what to use instead.

A value calculated from Today's date is worked out when it is used, and nothing recalculates it at midnight:

  • In a channel field, it is calculated each time the channel runs — after an import that changes any of its products, a publish, a template publish or Regenerate — and between runs it keeps the value from the last run.
  • In a Studio design, a value that changes every day means each product's design is rendered again, and uses Credits, whenever it is next rendered on a new day. To show a label rather than a running count, compare the date in an automation (for example "on or after 60 days ago") or in the catalog's Rules.
  • In a prompt, it is calculated when the prompt next writes content for the product — after a feed change, a prompt publish or an edit — and keeps that value until then. When that happens, the changed input means new content is generated, which uses Credits.

When Renable won't publish#

When a date step can't work, Publish stops and names the step, so a broken step never quietly empties a value in your ads. The step also shows the problem in red in the value editor. What it means and the fix:

  • No unit on a Date difference or Shift date — choose minutes, hours, days, weeks, months or years.
  • No other date on a Date difference — choose the date to count to.
  • No amount on a Shift date, or an amount that isn't a whole number — enter a whole number such as 7 or -7, or choose a field.
  • An output pattern that can't be used on a Format date — use date letters such as yyyy, MM and dd, for example yyyy-MM-dd.
  • A time zone that isn't recognised — choose UTC or a region such as Europe/Stockholm.
  • A Format date step before a Date difference or Shift date — Format date turns the date into text, so the step after it has no date to work with. Move the Format date step after it.
  • A Format date step on the other date of a Date difference — leave it out, and format the result after the step instead.
  • A Format number step on a field used in a calculation — the amount of a Shift date, or a field in a Math step, must stay a number. Remove its Format number step and format the result after the calculation instead.