time_add

Adds time to date.

To add time, pass the key of what time you want to add, and the amount you want to add.

Key can be one of the following:

  • M - months

  • w - weeks

  • d - days

  • h - hours

  • m - minutes

  • s - seconds

{% assign date = "2021-06-07" | time_add: 7, "days" | date: "%Y-%m-%d" %}
{{ date | log }}

Above snippet would log 2021-06-14 to logs.

Last updated