2

How to reference Sysdate in qweb in odoo 11?

I need to compare a date with "sysdate" in qweb, but I'm not able to get the current date.

Filippo Scifo
  • 71
  • 1
  • 11

2 Answers2

1

This way you can get date and time

<span t-esc="context_timestamp(datetime.datetime.now()).strftime('%Y-%m-%d %H:%M')"/> 

If you want only date

<span t-esc="context_timestamp(datetime.datetime.now()).strftime('%Y-%m-%d')"/> 
sfx
  • 1,793
  • 17
  • 24
0

like this you can get the today's date.

<span t-esc="context_timestamp(datetime.datetime.now()).strftime('%d/%m/%Y')"/>
Dipen Shah
  • 2,396
  • 2
  • 9
  • 21