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 3698974
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:02:48+00:00 2026-05-19T05:02:48+00:00

I am using a sysdate query in code to obtain the last updated rows

  • 0

I am using a sysdate query in code to obtain the last updated rows in the past 3 hours (should be configurable). The database runs in GMT timezone and the application runs in PST timezone. The query looks like this

select * from <table> where updated_Date  < sysdate - numdtodsinterval(3,'hour')

What is the recommended/best practice to firing such queries from application which has different timezones from the db.

  • 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-05-19T05:02:49+00:00Added an answer on May 19, 2026 at 5:02 am

    I would have to say that the best practice for an application that covers a lot of timezones is to stop using the DATE datatype and start using the TIMESTAMP with TIMEZONE datatype.

    I’m not saying that’s easy, just sayin’ that’s probably a best practice for a couple of reasons.

    The main is that it eliminates any and all ambiguity. If you use DATE, no one can tell what that value was calculated based on. You know. Maybe you have a comment on the column (ideal) but maybe overlooked. If it’s a TIMESTAMP with TIMEZONE datatype, you’ve nailed a specific moment in time independent of my local clock.

    But this assumes that you can change the database schema, which you probably can’t. So this serves as a warning for your next date column.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When i query the database using sysdate i get the sysdate with PST timing.
I'm using this sql query: select sysdate, sysdate - INTERVAL '6' month from dual;
I am trying to transpose columns to rows using query similar to the following...
I easily get Week Number using MySql Week function like this WEEK(SYSDATE()) I just
Im using the following query to target results that are exactly X days older
I'm using oracle 11g. I'm inserting date and time using function SYSDATE into column
I am using spring with hibernate. my database is oracle. i want to update/save
Hi I am using sqldeveloper conected to an oracle database. My senario is I
I created a Materialized view using the following code: CREATE MATERIALIZED VIEW M_USER_HIERARCHY BUILD
I have a database that I have populated using CREATE and INSERT INTO statements.

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.