2

In Odoo, I'd like to print current date in English in QWeb report:

<span t-esc="datetime.datetime.now().strftime('%d %B %Y')"/>

The expected behavior is : 20 January 2019

The current behavior is: 20 janvier 2019

What should I do to display the month in English instead of the system language (French)?

Mihai Chelaru
  • 7,614
  • 14
  • 45
  • 51
rma_bjr
  • 35
  • 1
  • 8

1 Answers1

1

try using LOCALE

import locale 

locale.setlocale(locale.LC_ALL, 'en_US')

print(datetime.datetime.now().strftime('%d %B %Y'))
Kannappan Sirchabesan
  • 1,353
  • 11
  • 21