S
S
Sergey Nizhny Novgorod2016-07-07 19:24:28
Django
Sergey Nizhny Novgorod, 2016-07-07 19:24:28

How to compare time in Django?

Hello.
There is a model with DataFiled. It is necessary to display all records with a date later than a certain date. How can I do this, I can not find something docks.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2016-07-07
@Terras

stackoverflow.com/questions/4668619/django-database...

Sample.objects.filter(sampledate__gt=datetime.date(2011, 1, 1),
                                sampledate__lt=datetime.date(2011, 1, 31))

Sample.objects.filter(date__range=["2011-01-01", "2011-01-31"])

google=django filter datefield

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question