Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add_Minute

Status
Not open for further replies.

mike778

Programmer
Jul 30, 2003
12
SE
Does anybody have a add_minute function?
In a library or something?

would be great, since I can't find an oracle minute function and i am to lazy to make one.

thanks,

Michael

 
select sysdate + 60/86400 from Dual;

shows how it is done: 60 seconds in a minute/86400 seconds in a day

I use + 86399/86400 a lot to make my end dates end at the end of the day

I tried to remain child-like, all I acheived was childish.
 
Great, thank you!
This saves me a lot of time!
So I am done for today then. :)

greetings, Michael
 
Mike, First, I expect great things from you/anyone who can get other people to do their work for them <smile>. Secondly, you are not &quot;done for today&quot; unless you get the FUNCTION you asked for. So, here you go:

create or replace function add_minute (date_in in date) return date is
begin
return date_in+(1/24/60);
end;
/

select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') now,
to_char(add_minute(sysdate),'yyyy-mm-dd hh24:mi:ss') future
from dual;

NOW FUTURE
------------------- -------------------
2003-08-05 09:34:47 2003-08-05 09:35:47

Cheers,

Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top