title: Visual Studio Windows Form Date Formatting to CSV
body: <p>Good morning all,</p>
  <p>First of all, thank you for taking the time to read my post, its my first, please be gentle :)
  I have created a windows form using VS2019 /c#. The user inserts the data and hits &quot;insert&quot; which then saves the data as a CSV file. Tableau then reads the CSV file, which all works. However I need the date format as yyyy-MM-dd. I cannot for the life of me get that to work. It always saves as MM-dd-yyyy. I am using a datetimepicker. Please see my code below for more info, and thank you so much for your help.</p>
  <pre><code>            Excel.Workbook xlworkbook;
              Excel.Worksheet xlworksheet;
              object misValue = System.Reflection.Missing.Value;
  
              xlworkbook = xlap.Workbooks.Add(misValue);
  
              xlworksheet = (Excel.Worksheet)xlworkbook.Worksheets.get_Item(1);
  
              Excel.Sheets worksheets = xlworkbook.Worksheets;
              worksheets[3].Delete();
              worksheets[2].Delete();
  
              xlworksheet.Cells[1, 1] = textBox1.Text;
              xlworksheet.Cells[1, 2] = dateTimePicker1.Value.ToString(&quot;yyyyMMdd&quot;);
              xlworksheet.Cells[1, 3] = textBox2.Text;
              xlworksheet.Cells[1, 4] = textBox3.Text;
              xlworksheet.Cells[1, 5] = textBox4.Text;
              xlworksheet.Cells[1, 6] = textBox5.Text;
              xlworksheet.Cells[1, 7] = textBox6.Text;
              xlworksheet.Cells[1, 8] = textBox7.Text;
              xlworksheet.Cells[1, 9] = textBox8.Text;
              xlworksheet.Cells[1, 10] = textBox9.Text;
              xlworksheet.Cells[1, 13] = textBox10.Text;
              xlworksheet.Cells[1, 11] = comboBox1.Text;
              xlworksheet.Cells[1, 12] = comboBox2.Text;
  
              xlworkbook.SaveAs(@&quot;\\172.21.4.14\BusinessLanding\BusinessLanding_Sync\operations_sync\FlightPlanning\savings_&quot; + DateTime.Now.ToString(&quot;yyyyMMddHHmmss&quot;) + &quot;.csv&quot;, Excel.XlFileFormat.xlCSVWindows);
              xlworkbook.Close(true);
              xlap.Quit();
  
  private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
      {
          
      }
  
        
  </code></pre>