Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

172
Views
Compare dates using ORM

I have a table containing column A of type "timestamp with time zone".

I want to get elements from this table having A >= now with timezone - 30 minutes

So I tried this code:

b = db.query(models.My_Class).filter(models.My_Class.A >= datetime.now(pytz.utc) + timedelta(minutes=-30)).first()

Expected result:

  • getting a record if exist with a date respecting this condition

  • getting none if no records respects this condition

Actual result:
I'm getting a record not satisfying the condition

Is there something wrong in my query?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!