Skip to content

Date Subtract

Input
value
Subtract 1 years from value
transformation:
dateSubtract

Subtract a duration from a date field

source:value
parameters
amount

How much time to add or subtract from the source date (used together with unit).

unit

Time unit paired with amount.

inputFormat

How the source field date string is parsed before the calculation.

outputFormat

How the calculated date is formatted when written to the output field.

Output
value
2023-01-15
2023-06-01
2022-12-31
2023-02-28
invalid-date

Sample inputs run locally in your browser using the same operation logic as Fontana Flow.
Results are illustrative, not connected to a workflow.

Subtract a duration from a date field.

Parameters

  • amount (Amount, number, required) — How much time to add or subtract from the source date (used together with unit). Examples: 1, 7, 30.
  • unit (Unit, string, required) — Time unit paired with amount. Allowed values: years, months, weeks, days, hours, minutes, seconds.
  • inputFormat (Input format, string, optional) — How the source field date string is parsed before the calculation. Examples: "yyyy-MM-dd", "MM/dd/yyyy", "dd-MM-yyyy".
  • outputFormat (Output format, string, optional) — How the calculated date is formatted when written to the output field. Examples: "yyyy-MM-dd", "MM/dd/yyyy", "dd-MM-yyyy".

Field selection

  • source — Field whose values this operation reads. Omit to apply to all fields on the row.
  • target — Optional output field. When omitted, the source field is updated in place.

JSON Configuration

{
"id": "op-dateSubtract",
"type": "transformation",
"action": "dateSubtract",
"params": {
"inputFormat": "yyyy-MM-dd",
"outputFormat": "yyyy-MM-dd",
"amount": 1,
"unit": "years"
},
"testInputs": [
"2024-01-15",
"2024-06-01",
"2023-12-31",
"2024-02-29",
"invalid-date",
""
]
}