Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: subtract minute from date/time

RE: subtract minute from date/time

From: <Simon.Anderson_at_scisys.co.uk>
Date: Thu, 11 Apr 2002 04:33:28 -0800
Message-ID: <F001.00441856.20020411043328@fatcity.com>

I'm glad its not just me thats having a bad morning making the numbers work...

My understanding of it goes something like this:

When working with date/times, oracle considers 1 to mean "One day".

There are 24 hours in every day, so to get the figure for one hour you use 1/24 eg sysdate - 1/24 would give you the time one hour ago.

There are 60 minutes in each hour, so one minute is 1/(24*60) Which is 24 hours times 60 minutes

Similarly, if you wanted seconds there are 60 in each minute, so 1 second is 1/(24*60*60)
Thats one day divided by (number of hours in a day * number of minutes in an hour * number of seconds in a minute)

You can probably do the same thing with decimals, but the numbers are messy. If Oracle handled anything smaller than a second, we'd probably start seeing issues with rounding errors...

Hope thats clear and I haven't made any obvious mistakes.

Simon Anderson

-----Original Message-----

Sent: Thursday, April 11, 2002 14:08
To: Multiple recipients of list ORACLE-L

I want to subtract a minute from a date/time

How can I do this?

John
--

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author:
  INET: Simon.Anderson_at_scisys.co.uk

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists

--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Thu Apr 11 2002 - 07:33:28 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US