[IMP] document date and datetime conversions
authorXavier Morel <xmo@openerp.com>
Tue, 9 Oct 2012 10:10:51 +0000 (12:10 +0200)
committerXavier Morel <xmo@openerp.com>
Tue, 9 Oct 2012 10:10:51 +0000 (12:10 +0200)
bzr revid: xmo@openerp.com-20121009101051-rsdq3u3ues022wuc

doc/import.rst

index 44e99e8..bffb1af 100644 (file)
@@ -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
 ++++++++++++