This question has been flagged
1 Reply
12317 Views

How can I include today's date—not the invoice date, or sales order date, etc.—in the Jinja2 template for an email? I've tried using normal `datetime` functions, but they seem to crash the template.

Avatar
Discard
Best Answer

use ${datetime.datetime.today().date()} in the template

Avatar
Discard
Author

Perfect. Thanks. If it helps anyone else, I was able to calculate an invoice's days past due with ${(datetime.datetime.today().date()-object.date_due).days}