Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

adding seconds to timestamps

732261Nov 6 2009 — edited Nov 10 2009
how to add second to timestamps or date.?
i have tried below query to add seconds in timestamps.

select
to_char(systimestamp,'dd-mm-yyyy hh24:mi:ss') as ts,
to_timestamp(
to_char(sysdate,'dd-mm-yyyy hh24:mi:')
||
to_char(
to_number(
to_char(systimestamp,'ss')
) + 10),'dd-mm-yyyy hh24:mi:ss'
) as ts_1
from dual

the above query is working fine.
but suppose in case if original seconds(system time) are 45 sec then if we tried to add 30 seconds then it throws error saying that seconds should be between 0 and 59.
i got the main cause of this error but not able to correct it and how to resolve this error.


plz reply......
thnx in advnc.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 8 2009
Added on Nov 6 2009
3 comments
9,943 views