I am trying to write a date string to an Excel file. I use the following command to create a date string:
a = {datestr(date, 'yymmdd')} % date in format yymmdd
This returns a 1×1 cell containing the string '051019', for example, which has a leading zero.
If I write this to an Excel file with the following command:
xlswrite('a.xls', a)
cell A1 of the spreadsheet contains the following:
51019
The leading zero has been dropped.
Best Answer