Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Subtract minutes from a datetime object

807603Dec 11 2007 — edited Dec 11 2007
I am querying a db and selecting a date time object. how can I subtract for example 10 minutes from that date time object?

ultimately i am pulling the latest datetime from the database, to in turn do another query for data entered in the past 10 minutes.

which means I am trying to pull the current datetime - 10 minutes, then another query searching where datetime between datetime and datetime - 10mins. I found ways to do the difference between 2 date times, but this will be a dynamic value I always will be subtracting 10 minutes from.

I dont know if this is something that can be done in sql or not, but im trying to do it in java.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 8 2008
Added on Dec 11 2007
2 comments
1,778 views