---
title: Add units to Date
slug: add-units-to-date
docTags: 
createdAt: 2022-09-07T03:13:56.000Z
---

Adds number of units to a given date. There are multiple functions under this definition defined in the table below.

Give a negative value in "by" to execute a subtraction.

| Function Path | Description                    |
| ------------- | ------------------------------ |
| /adddminutes  | Adds minutes to the given date |
| /adddays      | Adds days to the given date    |
| /addmonths    | Adds months to the given date  |
| /addyears     | Adds years to the given date   |

### API Definition

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://orca.pathfix.com/functions/json/addminutes",
  "name": "Add API",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "28UsDqyeH3QRdmtVamSQT",
        "code": "\"output\": {\n        \"year\": 2020,\n        \"month\": 1,\n        \"day\": 20,\n        \"dayOfWeek\": 1,\n        \"dayOfYear\": 20,\n        \"hour\": 5,\n        \"hour12\": 5,\n        \"minute\": 0,\n        \"ISO\": \"2020-01-20T05:00:00Z\",\n        \"dateISO\": \"2020-01-20\",\n        \"posixSeconds\": 1579496400,\n        \"posixMilliSeconds\": 1579496400000,\n        \"ampn\": \"am\",\n        \"monthName\": \"Jan\"\n    }",
        "language": "200"
      },
      {
        "id": "yIX64DyIuDPJgBRFSfAWb",
        "code": "{\n    \"message\": \"error\"\n}",
        "language": "404"
      }
    ],
    "selectedLanguageId": "28UsDqyeH3QRdmtVamSQT"
  },
  "examples": {
    "languages": [
      {
        "id": "ENcJz9TStG38F0X-taA4x",
        "code": "{\r\n\t\"input\": \"2020-01-20T10:30\",\r\n\t\"ny\": \"-330\"\r\n}",
        "language": "json"
      }
    ],
    "selectedLanguageId": "ENcJz9TStG38F0X-taA4x"
  },
  "description": "\nCall the following API:",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::















