On 19 Mar 21:09, Raimon Esteve wrote: > I > El 19/03/2014 20:29, "Jordi Esteve" <jest...@zikzakmedia.com> va escriure: > > > > There is a way to get the default datetime value for now in Tryton? > > > > To get a default date for today there is today() method in Date class. It > is overwritten in company module to take into account the timezone of the > company. > > > > But I am missing a now() method to get the a default datetime value that > also takes into account the timezone of the company. It will be useful to > fill a default datetime field, for example. Maybe I must write an issue. > > It's older codereview and need to add timezone > > http://codereview.tryton.org/507002/ > > Arguement about this topic: > > https://groups.google.com/forum/m/#!msg/tryton-dev/-XjVVeQQ3XU/0q5q_VHM5IUJ > > IMHO is necessary now method when like get date today and hour now.
It is not. datetime.now() will return now in UTC which is always now in any timezone. Tryton switched for 3.2 to good practice which is to always work/store/manipulate UTC. So adding a Date.now() that return now with an other timezone will just create bad practice. -- Cédric Krier - B2CK SPRL Email/Jabber: cedric.kr...@b2ck.com Tel: +32 472 54 46 59 Website: http://www.b2ck.com/
pgpmtJZDQLvnn.pgp
Description: PGP signature