I tried on google but I did not find a solution. On the Djangoadmin side, I show the start date and end date with time. But time is in format 24 hr, and I want to display it in format12 hr
class CompanyEvent(models.Model):
title = models.CharField(max_length=255)
date_start = models.DateTimeField('Start Date')
date_end = models.DateTimeField('End Date')
notes = models.CharField(max_length=255)
class Meta:
verbose_name = u'Company Event'
verbose_name_plural = u'Company Events'
def __unicode__(self):
return "%s (%s : %s)" % (self.title, self.date_start.strftime('%m/%d/%Y'), self.date_end)
I also found out this one , but that doesn't help me.
I am new to pythonand Django. Please help.

source
share