Add or subtract days to a date object

Hi all,
I am creating a Workflow state escalation that works much like the following example (taken from another topic of this forum):

{# grab the current date and time string #}
{% now "h:m m-d-y" as date_time_string %}

{# convert the date time string into a date object #}
{% set date_time_string|date_parse as now_date_object %}

{# convert the metadata expiration date string into a date object #}
{% set document.metadata_values_of.expiry_date|date_parse as expiration_date_object  %}
{% if now_date_object > expiration_date_object %}
{% endif %}

However, I want to be notified 30 days before the actual date of expiration. How can I change “expiration_date_object” to 30 days earlier?

I guess that “timedelta” keyword is involved here, but I cannot find any example of how to use it.

Thanks so much for your work.

Knowledge Base articles on the topic:

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.