Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8712565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:08:16+00:00 2026-06-13T05:08:16+00:00

This really shouldn’t be this hard but for some reason I can’t seem to

  • 0

This really shouldn’t be this hard but for some reason I can’t seem to get it.

I am trying to run a filter on my query that compares the date range between today, and the first day of next year.

Getting today is no problem, but I can’t seem to get the first day of next year. I want to be able to provide myself with Jan 1/2013

Here is my filter so far:

cur_il = Investment.objects.all().filter(plan = plan).order_by('financial_institution').filter(maturity_date__range=[now, nextyear])

Obviously I use this to get today’s date:

now = datetime.now()

How can I get the next date?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:08:17+00:00Added an answer on June 13, 2026 at 5:08 am

    Does this work?

    >>> today = datetime.datetime.now()
    >>> next_year = datetime.datetime(year=today.year+1, month=1, day=1)
    >>> next_year
    datetime.datetime(2013, 1, 1, 0, 0)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This really shouldn't be hard, I just can't figure out how to do it.
I guess this is really simple, but I can't get it to work. I
I have no idea why, and this seems illogical, but for some reason the
This really shouldn't be this complicated, which suggests I'm doing something wrong, but after
I know I'm missing something obvious here but I can't seem to get my
This is a small doubt and something that shouldn't really come to one's mind.So
At first, this exception doesn't really make sense to me. Why shouldn't i be
This should be really simple, but I have tried many solutions posted on the
This seems like it should be really simple, but I'm unable to figure this
This seems like it should be really easy but I couln't find an answer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.