Skip to main content

Manipulate Date Mutation

The Manipulate Date mutation allows you to add or subtract a specified amount of time from a date value. It accepts dates, Unix timestamps, and date strings, and always returns a date. This is useful for shifting publication dates, calculating expiry dates, or adjusting any date-based field in your product feed.

Warning

If the input value cannot be parsed as a date, the mutation will return no value.

Options

  • Operation: Whether to Add or Subtract the amount of time.
  • Amount: The number of units to add or subtract. Accepts a static number or a dynamic field reference.
  • Unit: The time unit to apply — Minute, Hour, Day, Week, Month, or Year.

Example

Adding 7 days to a product's sale end date to extend a promotion by one week.

A screenshot showing the Manipulate Date mutation.
Manipulate Date Mutation Example