title: Write dates to Excel properly from R
body: <p>When I write dataframe to the file it considers all columns as characters including the date column. </p>
  
  <pre><code>options(xlsx.date.format = "yyyy-mm-dd")
  write.xlsx(data, excel_filename, sheetName = "Data")
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/RwXbs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RwXbs.png" alt="enter image description here"></a></p>
  
  <p>How can I write data to xlsx file such that when I work with this column it considered as date by default? </p>
  
  <p><strong>Solution:</strong> Turns the class of the column was character. After conversion with <code>as.Date</code> everything is saved properly. </p>