Subtract minutes from a datetime object
807603Dec 11 2007 — edited Dec 11 2007I 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.