“Formatowanie dat Django” Kod odpowiedzi

Format daty w szablonie Django

{{ request.user.date_joined|date:"Y-m-d H:i:s" }}
Difficult Donkey

Formatowanie dat Django

<p>Birthday: {{ birthday|date:"M d, Y" }}</p>
Testy Trout

Formatowanie dat Django

# 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) )
Testy Trout

Odpowiedzi podobne do “Formatowanie dat Django”

Pytania podobne do “Formatowanie dat Django”

Więcej pokrewnych odpowiedzi na “Formatowanie dat Django” w Python

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu