title: What exactly does trunc(date, 'IW')?
body: <p>For my project I need to have an absolute numerical correspondence between days of the week and 1...7 values. </p>
  
  <p>As you probably know the association between days and numbers can vary according to the locale, for example in Germany Monday is 1 and Sunday is 7, while in US Monday is 2 while Sunday is 1.</p>
  
  <p>So, searching for a solution, I found the following code which seems working regardless of the locale, assigning Monday=1...Sunday=7:</p>
  
  <pre><code>1 + TRUNC (date) - TRUNC (date, 'IW')
  </code></pre>
  
  <p>Can someone explain me how does it work? In particular I just can't understand what this instruction:</p>
  
  <pre><code>TRUNC (date, 'IW')
  </code></pre>
  
  <p>exactly does.</p>