How to display cell with number format "Short Date" using openpyxl? [duplicate]

Found another article that worked out well with minmal code:

writer = pd.ExcelWriter('Sample_Master_Data_edited.xlsx', engine='xlsxwriter', 
                        date_format='mm/dd/yyyy', datetime_format='mm/dd/yyyy')

Reference


Most likely, it won't be enough to change the format of your date - you'll have to store the date as a string instead of a datetime object.

Loop over the column and format the dates with datetime.strftime:

for row in range(1, ws_kont.max_row+1):
    cell = ws_kont.cell(row = row, column = 4)
    cell.value = cell.value.strftime('%Y-%m-%d')