title: T-SQL replacing day and month when setting datetime variable value on SQL Server 2017
body: <p>When I'm setting <code>datetime</code> variable value the day and month is switched. </p>
  
  <p>For example:</p>
  
  <pre><code>declare @date datetime = '2017-12-02 14:56:24.000'
  select datepart(month,@date)
  </code></pre>
  
  <p>The result should be 12 but it's 2. The problem exists only on SQL Server 2017. The same code on 2016 returns 12.</p>