---
title: "Add certain number of minutes/hours/days/weeks/months to a date"
canonical: "https://support.appfire.com/space/JMWEC/466226307/Add%20certain%20number%20of%20minutes%2Fhours%2Fdays%2Fweeks%2Fmonths%20to%20a%20date"
format: markdown
---
> Macro (aura-html)

### Abstract

This code snippet adds a certain number of <span style="color: #091e42">minutes/hours/days/weeks/months </span>to a Date field.

### Logic

Access the date and add the number of <span style="color: #091e42">minutes/hours/days/weeks/months </span>to it.

### Snippet 

```javascript
{{ <Date field> | dateadd(<Number of units>,"<Unit>") }}
```

### Placeholders

| Placeholder | Description | Example |
| --- | --- | --- |
| `<Date Object`> | Access a date field | `issue.fields.created` |
| <sup><Number of units></sup> | The number of units to be added | `5` |
| `<Unit>` | `is one of "days", "hours", "weeks" or "months" (or their equivalent: "d", "h", "w", "m")` | `days` |

### Examples

The output of the code snippet is a [Moment.js](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/466323491)<span style="color: #333333"> date object</span> which you could use to:

- Set <span style="color: #333333">a Date/Date-time picker field - Eg: Set the Due date to issue created plus 1 month in</span>
  - one of the Set Field Value post-functions
  - one of the Transition issue post-functions on the transition screen, if any
  - in the Create issue post-function under Set fields of new issue section
    
- Conditionally execute a post-function or Unlink issues - <span style="color: #333333">Eg: Check that the issue has been resolved for more than 10 days</span>
  
- <span style="color: #333333">Notify the customer that the issue will be resolved in 6 hours from now through the</span>
  - Comment in one of the Comment issue post-functions
  - Subject/HTML body/Text body of Email issue post-function
    
- Write a JQL search expression in the Link issues to current issue post-function - Eg: Link issues whose "Planned Delivery date" is less than two days
  

### References

- [Using Nunjucks Templates](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465503811)
- [Accessing JIRA Standard fields](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/466225701)
- [now variable](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465373277)
- [Date filter](https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/466323491)

### Related articles

> Macro (contentbylabel)

> Macro (details)
> 
> | Related issues |  |
> | --- | --- |