I am adding 14 days to the current day and then I wanna export this to excel. in Visual Studio it shows the date as 26-03-2019. But the moment I export it to Excel it shows it in the cell-like 26/03/2019. My questions are how can I change this?
I changed the date format but this doesn't work.
This is my code.
Textbox1.Text = DateTime.Now.AddDays(14).ToString("dd-MM-yyyy");
worksheet.Cells[1, 2] = Textbox1.Text;
I dont know what I should change to get the date format in 26-03-2019 instead of 26/03/2019 in excel.