plsql - PL/SQL Adding hours to timestamp parameter -


i got parameter

:datefrom  

which gonna used argument in function timestamp. need add :datefrom + 7 hours, how can that?

if parameter not timestamp, use to_timestamp or to_date convert it:

to_timestamp(datefrom,'mm/dd/yyyy hh24:mi:ss') 

(substitute appropriate mask based on format of input parameter)

then add 7/24.

to_timestamp(datefrom,'mm/dd/yyyy hh24:mi:ss') + 7/24; 

adding 1 adds full day, adding 1/24 adds 1 hour.

this can done interval operator:

to_timestamp(datefrom,'mm/dd/yyyy hh24:mi:ss') + interval '7' hour 

Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -