I need to figure out how to do some basic date subtraction in oracle. Given one date "Tue, 03 Jun 2001 15:12:35", I need to subtract an arbitrary number of seconds.
for example: The above date - 3600 would equal "Mon, 02 Jun 2001 15:12:35";
What is the command for this? I have tried date_sub (), but that does not appear to work
Thanks
R
07-03-2001, 10:44 AM
marist89
Date subtraction returns number of days. For example:
first, expand our default date format...
Code:
SQL> alter session set nls_date_format="mm/dd/yyyy hh24:mi:ss";
it's really clearer with Oracle, and there is no way to do it elsewhere ... why should it be since it's one of the simplest implementation of time calculation you can find ...
nevertheless if you want you still can build a function which substracts the number of seconds given as an argument, but I wouldn't see any use of it ...