How to Round Timestamps

select to_timestamp('2013-08-22 06:00:00','YYYY-MM-DD HH24:MI:SS') original_value,
       to_char(to_timestamp('2013-08-22 06:00:00','YYYY-MM-DD HH24:MI:SS'), 
         'mm/dd/yyyy hh') as value_trunc_to_hh,
       to_char(to_timestamp('2013-08-22 06:00:00','YYYY-MM-DD HH24:MI:SS'), 
         'mm/dd/yyyy hh:mm') as value_trunc_to_minute,
       to_char(to_timestamp('2013-08-22 06:00:00','YYYY-MM-DD HH24:MI:SS'), 
         'mm/yyyy') value_trunc_to_month
from dual;
original_value value_trunc_to_hh value_trunc_to_minute value_trunc_to_month
2013-08-22 06:00:00.0 08/22/2013 06 08/22/2013 06:08 08/2013

IN THIS PAGE