DataJet
Search…
time_subtract
Subtracts time from date.
To subtract time, pass the key of what time you want to add, and the amount you want to subtract.
Key can be one of the following:
    M - months
    w - weeks
    d - days
    h - hours
    m - minutes
    s - seconds
1
{% assign date = "2021-06-07" | time_subtract: 7, "days" | date: "%Y-%m-%d" %}
2
{{ date | log }}
Copied!
Above snippet would log 2021-05-31 to logs.
Last modified 4mo ago
Copy link