Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
13945 Tampilan

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
Buang
Jawaban Terbai

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

Avatar
Buang
Penulis

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}

Post Terkait Replies Tampilan Aktivitas
3
Jun 25
558
5
Mei 25
17296
0
Apr 25
803
1
Apr 25
1054
0
Mar 25
1001