From 96ffc4401a18c1d4b798c01970d0f3b40258a206 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 9 Oct 2012 12:10:51 +0200 Subject: [PATCH] [IMP] document date and datetime conversions bzr revid: xmo@openerp.com-20121009101051-rsdq3u3ues022wuc --- doc/import.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/doc/import.rst b/doc/import.rst index 44e99e88d3e..bffb1af334b 100644 --- a/doc/import.rst +++ b/doc/import.rst @@ -169,6 +169,31 @@ an UPDATE with the non-db values for the relational field. Otherwise a CREATE command is emmitted. +Date fields +~~~~~~~~~~~ + +The value's format is checked against +:data:`~openerp.tools.misc.DEFAULT_SERVER_DATE_FORMAT`, an error is +generated if it does not match the specified format. + +Datetime fields +~~~~~~~~~~~~~~~ + +The value's format is checked against +:data:`~openerp.tools.misc.DEFAULT_SERVER_DATETIME_FORMAT`, an error +is generated if it does not match. + +The value is then interpreted as a datetime in the user's +timezone. The timezone is specified thus: + +* If the import ``context`` contains a ``tz`` key with a valid + timezone name, this is the timezone of the datetime. + +* Otherwise if the user performing the import has a ``tz`` attribute + set to a valid timezone name, this is the timezone of the datetime. + +* Otherwise interpret the datetime as being in the ``UTC`` timezone. + Create/Write ++++++++++++