Thanks<br><br><div class="gmail_quote">On Wed, May 2, 2012 at 8:27 PM, Chris Rebert <span dir="ltr"><<a href="mailto:clp2@rebertia.com" target="_blank">clp2@rebertia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Wed, May 2, 2012 at 7:49 AM, Nikhil Verma <<a href="mailto:varma.nikhil22@gmail.com">varma.nikhil22@gmail.com</a>> wrote:<br>
<snip><br>
<div class="im">> def __unicode__(self):<br>
> return "%s %s" % (<a href="http://self.name" target="_blank">self.name</a>, self.date_created.strftime("%A %B %d"))<br>
><br>
><br>
> The user fills Gen GI in name and date along with time.<br>
><br>
> What i am able to achieve with this class object to return is :-<br>
><br>
> Gen GI Monday May 7<br>
><br>
> I want that the this class should return object like this :-<br>
><br>
> Gen GI Monday AM, May 7<br>
> Pancreas Tuesday PM, May 8<br>
><br>
> How can achieve AM and PM also ? with this datetime object<br>
<br>
</div>Consult the docs.<br>
<a href="http://docs.python.org/library/datetime.html#strftime-and-strptime-behavior" target="_blank">http://docs.python.org/library/datetime.html#strftime-and-strptime-behavior</a> :<br>
"%p -- Locale’s equivalent of either AM or PM."<br>
<br>
So, strftime("%A %p, %B %d").<br>
<br>
Regards,<br>
Chris<br>
</blockquote></div><br><br clear="all"><br>-- <br>Regards<br>Nikhil Verma<br>+91-958-273-3156<br><br>