title: What is the default date style used by an instance of SQL Server when converting from varchar to datetime?
body: <p>I've run this SQL query on two different servers:</p>
  
  <pre><code>declare @test as datetime='2020-05-06 00:00:00'
  select Convert (nvarchar,@test) 
  </code></pre>
  
  <p>The results were different on the two servers:</p>
  
  <ol>
  <li>May  6 2020 12:00AM</li>
  <li>Jun  5 2020 12:00AM</li>
  </ol>
  
  <p>I know the reason behind this, when SQL Server is reading the string that I passed <code>2020-05-06 00:00:00</code> and converting it to <code>DateTime</code> in the declare statement, it's using the default date style.</p>
  
  <p>Am I able to configure this default style, or in other words, how is default date style chosen in SQL Server when converting the <code>varchar</code> to <code>datetime</code>? Is it from the windows regional settings or some other configurations inside SQL Server?</p>