Re: DateTimeField: Hide clock

37 views
Skip to first unread message

jirka.v...@gmail.com

unread,
Oct 23, 2014, 7:50:36 AM10/23/14
to django...@googlegroups.com
Look at the "date" filter in template documentation, allows you to customize the output.

HTH

Jirka
From: Oskar Lyrstrand <oskar.l...@gmail.com>
Date: Thu, 23 Oct 2014 03:28:10 -0700 (PDT)
Subject: DateTimeField: Hide clock

models.py:
class Post(models.Model):
    pub_date
= models.DateTimeField

template.html:
{{ post.pub_date }}

output:
 23 october 2014 19:25

Problem is I dont want "19:25" to show. What can I do?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/bd6c974f-5762-48c1-92c3-65b338345b85%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Roseman

unread,
Oct 23, 2014, 7:52:30 AM10/23/14
to django...@googlegroups.com
On Thursday, 23 October 2014 11:28:10 UTC+1, Oskar Lyrstrand wrote:
models.py:
class Post(models.Model):
    pub_date
= models.DateTimeField

template.html:
{{ post.pub_date }}

output:
 23 october 2014 19:25

Problem is I dont want "19:25" to show. What can I do?


Why are you using DateTimeField if you don't want the time? Why not just use DateField?
--
DR. 
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages