Community mailing list archives
Re: Problem with datetime field (Odoo9)by
Mustafa Babiker El-Siddig Mustafa Hamad
Yes this is true. I faced the same issue with the Arabic language.
On Jan 25, 2016 9:34 AM, "Martin Trigaux" <firstname.lastname@example.org> wrote:
Hello, This depends of the locales installed on your machine. >>> import datetime >>> datetime.datetime.strptime('2016-01-19 14:00:00', '%Y-%m-%d %H:%M:%S').strftime('%A') 'Tuesday' >>> import locale >>> locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8') 'fr_FR.UTF-8' >>> datetime.datetime.strptime('2016-01-19 14:00:00', '%Y-%m-%d %H:%M:%S').strftime('%A') 'mardi' 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) https://odoo.com https://github.com/mart-e