Re: date/time arithmetic
Date: 10 Mar 1995 00:43:19 GMT
Message-ID: <3jo7b7$idm_at_news.csus.edu>
Eric Pierce (sac50216_at_saclink1.csus.edu) wrote:
: Raymond Bowen (rbowen_at_access3.digex.net) wrote:
: : I am writing a stored procedure that is attempting to add three
: : hours to a date (i.e. SYSDATE). Any idea in how to do this?
: :
: : --
: : ==========================================================
: : Raymond C. Bowen III
: : Principal Computer Consultant
: : P.O. Box 32311
: : Baltimore, Maryland 21208-8311
: : Voice Mail (410) 922-6311 Fax (410) 922-6311
: : e-mail: rbowen_at_access.digex.net
:
: My server is down for backups, so I can't test it:
:
: select to_char(sysdate, "HH:MI:SS"), to_char(sysdate+3/24, "HH:MI:SS")
: from dual;
:
: I vaguely recall that you can add/subtract integer values as days to
: dates, so 3/24 is 3 hours?
:
: Any corrections or other feedback is appreciated,
:
: EP
test script output:
Date: Thu, 9 Mar 1995 16:31:09 PST8PDT
To: sac50216_at_saclink1.csus.edu
Subject: time addition in Oracle SQL*Plus
Thu Mar 09 page 1 sysdate sysdate+3 hours ------------------------- ------------------------- 09-MAR-1995 04:29:50 09-MAR-1995 07:29:50 1 select 2 to_char( sysdate, 'DD-MON-YYYY HH:MI:SS' ) "x1" 3 , 4 to_char( sysdate+3/24, 'DD-MON-YYYY HH:MI:SS' ) "x2" 5 from 6* dual
EP Received on Fri Mar 10 1995 - 01:43:19 CET