i want to display only the year from request_date_from in a q-web report
i tried this code
<span t-esc="datetime.datetime.strptime(o.request_date_from, '%Y-%m-%d').strftime('%Y')"/>
but i get this error
Error to render compiling AST TypeError: strptime() argument 1 must be str, not datetime.date Template: mymodule.leave
Path: /t/t/t/t/div/p/span
Node: <span t-esc="datetime.datetime.strptime(o.request_date_from, '%Y-%m-%d').strftime('%Y')"/>)
thank you @Ravi Gadhia