Community mailing list archives

Re: Problem with datetime field (Odoo9)

Mustafa Babiker El-Siddig Mustafa Hamad
- 01/25/2016 02:35:06

Yes this is true.  I faced the same issue with the Arabic language.


On Jan 25, 2016 9:34 AM, "Martin Trigaux" <> wrote:

This depends of the locales installed on your machine.

 >>> import datetime
 >>> datetime.datetime.strptime('2016-01-19 14:00:00', '%Y-%m-%d 
 >>> import locale
 >>> locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8')
 >>> datetime.datetime.strptime('2016-01-19 14:00:00', '%Y-%m-%d 

It depends a bit of what the code you downloaded is doing but it looks 
like it set the locale to Spanish somewhere.

On 25/01/16 02:27, Dominic RC wrote:
> selected_day = datetime.datetime.strptime('2016-01-19 14:00:00',
> '%Y-%m-%d %H:%M:%S').strftime('%A')
> when I execute the code from odoo, selected_day = 'martes', but if I
> execute the code from a simple python script selected_day =
> 'Tuesday', does this have anything to do with selected template language
> or any configuration for translated terms in odoo?

Martin Trigaux
Odoo (Formerly OpenERP)

Post to: