title: Python Convert time to UTC format
body: <pre><code>from django.utils import timezone
  time_zone = timezone.get_current_timezone_name() # Gives 'Asia/Kolkata'
  date_time = datetime.time(12,30,tzinfo=pytz.timezone(str(time_zone)))
  </code></pre>
  
  <p>Now I need to convert this time to UTC format and save it in Django model. I am not able to use <code>date_time.astimezone(pytz.timezone('UTC'))</code>. How can I convert the time to UTC. Also Back to 'time_zone'.</p>
  
  <p>This is a use case when user type time in a text box and we need to save time time in UTC  format. Each user will also select his own time zone that we provide from Django <code>timezone</code> module.</p>
  
  <p>Once the user request back the saved time it must be shown back to him in his selected time zone.</p>