title: Why do Python's datetime.strftime('%w') and datetime.weekday() use different indexes for the days of the week?
body: <p>In Python, showing the day of the week as an integer using <code>datetime.strftime()</code> shows a different result than using <code>datetime.weekday()</code>.</p>
  
  <pre><code>&gt;&gt;&gt; import datetime
  &gt;&gt;&gt; now = datetime.datetime.now()
  &gt;&gt;&gt; now.strftime('%A')
  'Sunday'
  &gt;&gt;&gt; now.strftime('%w') # Day of the week as an integer.
  '0'
  &gt;&gt;&gt; now.weekday() # Day of the week as an integer, a different way.
  6
  </code></pre>
  
  <p>With <code>strftime()</code>, the string format <code>%w</code> has Sunday as the first day of the week.  With <code>weekday()</code>, it's Monday instead.</p>
  
  <p><strong>What's the history of why these two are different?</strong></p>