Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django date formatting

# get the object details 
home = Home.objects.get(home_id=homeid)

# get the start date
_startDate = home.home_startdate.strftime('%m/%d/%Y')

# assign it to template 
return render_to_response('showme.html', {'home_startdate':_startDate},  context_instance=RequestContext(request) )
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #django #date #formatting
ADD COMMENT
Topic
Name
3+5 =