equal
deleted
inserted
replaced
470 if value is None: |
470 if value is None: |
471 return |
471 return |
472 if isinstance(value, unicode): |
472 if isinstance(value, unicode): |
473 value = value.encode(encoding) |
473 value = value.encode(encoding) |
474 elif isinstance(value, (date, datetime)): |
474 elif isinstance(value, (date, datetime)): |
475 # Do not use strftime, as it yields issue |
|
476 # with date < 1900 |
|
477 value = '%04d-%02d-%02d' % (value.year, |
475 value = '%04d-%02d-%02d' % (value.year, |
478 value.month, |
476 value.month, |
479 value.day) |
477 value.day) |
|
478 if isinstance(value, datetime): |
|
479 value += ' %02d:%02d:%02d' % (value.hour, |
|
480 value.minutes, |
|
481 value.second) |
480 else: |
482 else: |
481 return None |
483 return None |
482 # We push the value to the new formatted row |
484 # We push the value to the new formatted row |
483 # if the value is not None and could be converted to a string. |
485 # if the value is not None and could be converted to a string. |
484 formatted_row.append(value) |
486 formatted_row.append(value) |