Mega Code Archive

 
Categories / Oracle PLSQL / Date Timezone
 

Rounding to the nearest minute

SQL> SQL> SQL> -- Rounding to the nearest minute. SQL> SELECT TO_CHAR(ROUND(TO_DATE('070299 01:00:35 AM', 'MMDDYY HH:MI:SS AM'),   2             'MI'), 'DD-MON-YY HH:MI:SS AM') "Rounded to nearest Minute"   3  from DUAL; Rounded to nearest Mi --------------------- 02-JUL-99 01:01:00 AM SQL> SQL>