1
0
forked from ScoDoc/ScoDoc

clear timezone for datetime object

This commit is contained in:
Jean-Marie Place 2021-10-16 10:25:40 +02:00
parent 4ce50927b0
commit 7cc9f6d1f4

View File

@ -288,10 +288,6 @@ class ScoExcelSheet:
value -- contenu de la cellule (texte, numérique, booléen ou date)
style -- style par défaut (dictionnaire cf. excel_make_style) de la feuille si non spécifié
"""
if value is False:
value = 0
elif value is True:
value = 1
if isinstance(value, datetime.datetime):
value = value.replace(tzinfo=None) # make date naive (cf https://openpyxl.readthedocs.io/en/latest/datetime.html#timezones)
cell = WriteOnlyCell(self.ws, value or "")