Index: /main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.py	(revision 8379)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.py	(revision 8380)
@@ -23,4 +23,5 @@
 import grok
 import csv
+import datetime
 import os
 import tempfile
@@ -405,4 +406,12 @@
             # CSV writers like byte streams better than unicode
             value = value.encode('utf-8')
+        elif isinstance(value, datetime.datetime):
+            value = str(value)
+        elif isinstance(value, datetime.date):
+            # Order is important here: check for date after datetime as
+            # datetimes are also dates.
+            #
+            # Append hash '#' to dates to circumvent unwanted excel automatic
+            value = str('%s#' % value)
         elif value is None:
             # None is not really representable in CSV files
Index: /main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_batching.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_batching.py	(revision 8379)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_batching.py	(revision 8380)
@@ -16,4 +16,5 @@
 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 ##
+import datetime
 import doctest
 import logging
@@ -268,4 +269,7 @@
         result4 = exporter.mangle_value(u'string', 'foo')
         result5 = exporter.mangle_value(None, 'foo')
+        result6 = exporter.mangle_value(datetime.date(2012, 4, 1), 'foo')
+        result7 = exporter.mangle_value(
+            datetime.datetime(2012, 4, 1, 12, 1, 1), 'foo')
         self.assertEqual(
             (result1, result2, result3, result4, result5),
@@ -273,4 +277,8 @@
         self.assertEqual(type(result3), type('string'))
         self.assertEqual(type(result4), type('string'))
+        # dates are formatted with trailing hash
+        self.assertEqual(result6, '2012-04-01#')
+        # datetimes are formatted as yyyy-mm-dd hh:mm:ss
+        self.assertEqual(result7, '2012-04-01 12:01:01')
         return
 
