Good afternoon all,
As always, thank you in advance for your help.
I have made a windows form in VS 2019 and have a datetimePicker item. The form data is saved in CSV format and then used in Tableau.
The date is stored as ddMMyyyy when saved which is a huge problem. For example, If saved data on 5th Aug 2020, I want it to save it as YYYYMMDD (2020-08-05) but it saves it as 05-08-2020. When I open the saved file, it will show the date as May 08 2020.
I simply want the date format to save as YYYY-MM-DD..
- private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
- {
- dateTimePicker1.Format = DateTimePickerFormat.Custom;
- dateTimePicker1.CustomFormat = "yyyyMMdd";
- }
- Private void textbox8_Textchanged(object sender, EventArgs e)
- xlworksheet.Cells[1, 1] = textBox1.Text;
- xlworksheet.Cells[1, 2] = dateTimePicker1.Value;