PROBLEM:
We want to add to our template a sentence that mentions that your customer has 5 days to pay from today, and it should write the date of the deadline.
SOLUTION:
First, we need to get today's date by following this guide.
{{ datetime_now }}
It will show something like:
Feb. 26, 2025, 3:29 p.m.
Second, we will add 5 days to today's date by following this date manipulation guide.
{{ datetime_now|add_days:'5' }}
We now see this:
March 3, 2025, 3:29 p.m.
Third, we format the date to show only the abbreviation of the month and remove the time by following the first guide we read:
{{ datetime_now|add_days:'5'|date:"M. d, Y" }}
It gives the following result:
Mar. 03, 2025