libreoffice --headless --convert-to xlsx --infilter=xlsx:44,34,76 test1.csv

Hi ,

I am trying to convert csv to excel preserving UTF-8 format. However date format of csv is also getting changed, i wanted to preserver the same date fomat.

In CSV: date format i have as 8/25/2020 3:57:19 AM
but on conversion it is changed to : 08/25/20 03:57 AM

it is very urgent. i would appreciate any quick help

Conversion from the command line uses the default date+time format of the current locale. You can only import the CSV file and apply the desired date+time format to those cells:

M/D/YYYY H:MM:SS AM/PM

and then export to .xlsx

I have better solution.

libreoffice --headless --convert-to xlsx --infilter=CSV:44,34,76,1,9/2/10/2/11/2 test1.csv

its the same command, except we are making the columns 9 10 and 11 which are my dates column to consider as text
so that it wont make any changes to the format.

With the effect that if it’s text instead of dates it can’t be calculated with. Unless in a locale that uses the same date+time format and automatic locale dependent conversion from text to numeric is enabled, which can be a trap regarding M/D vs D/M order.