title: convert date and time format in django
body: <p>How to convert datefield of format <code>mm/dd/yyyy</code> to format <code>dd/mm/yyyy</code> and timefield of format <code>24hrs to 12hr AM/PM.</code></p>
  
  <p>This is i am using in below circumstances</p>
  
  <p>In database from a model i am getting values,so if the values getting from db is '0' the date and time format should be of <code>(dd/mm/yyyy and 12hr AM/PM).</code></p>
  
  <p>If the value from database field is '1',the format is of <code>(mm/dd/yyyy and 24hr)</code></p>
  
  <p>models.py</p>
  
  <pre><code>class Report(models.Model):
      user = models.ForeignKey(User, null=False)
      manual_date = models.DateField('Another date', null=True, blank=True)
      manual_time = models.TimeField('Another time', null=True, blank=True)
  
  class Settings(models.Model):
      date_format = models.CharField('Date format', max_length=100)
  time_format = models.CharField('Time format', max_length=100)
  </code></pre>
  
  <p>How to do.</p>
  
  <p>Thanks</p>