title: How to solve the strptime() caused naive datetime RuntimeWarning?
body: <p>I am trying to code without throwing any warnings in my console. So far I have been pretty good at avoiding it until this one case, which seems like a chicken and egg situation to me.</p>
  
  <pre><code>from datetime import datetime as dt 
  
  last_contacted = "19/01/2013"
  current_tz = timezone.get_current_timezone()
  date_time = dt.strptime(last_contacted, get_current_date_input_format(request))
  date_time = current_tz.localize(date_time)
  </code></pre>
  
  <p>The third line is throwing this warning:</p>
  
  <blockquote>
    <p>RuntimeWarning: DateTimeField received a naive datetime (2013-01-19
    00:00:00) while time zone support is active.)</p>
  </blockquote>
  
  <p>Its kind of odd, since I need to convert the unicode into a datetime first before I can convert the datetime object into an datetime-aware object (with timezone support) in the forth line.</p>
  
  <p>Any suggestions from experts?</p>
  
  <p>Thanks</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <pre><code>def get_current_date_input_format(request):
      if request.LANGUAGE_CODE == 'en-gb':
          return formats_en_GB.DATE_INPUT_FORMATS[0]
      elif request.LANGUAGE_CODE == 'en':        
          return formats_en.DATE_INPUT_FORMATS[0]
  </code></pre>