date_add - Liquid Filter Reference
On this page
Description
Adds a unit of time to a date and returns a datestamp in UTC. Valid units are: years, months, weeks, days, hours, minutes, and seconds
| Property | Value |
|---|---|
| Return Type | string |
| Category | dates |
Examples
liquid
{{ "2021-03-01T09:00:00Z" | date_add: days: 5 }}
Output: 2021-03-06T09:00:00Z
liquid
{{ "2021-03-01T09:00:00Z" | date_add: minutes: 5 }}
Output: 2021-03-01T09:05:00Z
liquid
{{ "2021-03-01T09:00:00Z" | date_add: weeks: 5 }}
Output: 2021-04-05T09:00:00Z
liquid
{{ "2021-02-28T23:00:00Z" | date_add: days: 5 }}
Output: 2021-03-05T23:00:00Z
liquid
{{ "2021-03-01T09:00:00Z" | date_add: days: -5 }}
Output: 2021-02-24T09:00:00Z