SELECT
  TO_CHAR(SYSDATE, 'DD-MON-RR HH:MI:SS')
  AS "SYSDATE"
FROM DUAL;
SELECT
  TO_CHAR(
    ROUND(SYSDATE)
    , 'DD-MON-RR HH:MI:SS AM')
  AS "ROUND"
FROM DUAL;
SELECT
  TO_CHAR(
    TRUNC(SYSDATE)
    , 'DD-MON-RR HH:MI:SS AM')
  AS "TRUNC"
FROM DUAL;

SELECT
  MONTHS_BETWEEN('01-SEP-14','01-AUG-14')
  AS "MONTHS_BETWEEN1"
FROM DUAL;
SELECT
  MONTHS_BETWEEN('15-SEP-14','01-AUG-14')
  AS "MONTHS_BETWEEN2"
FROM DUAL;
SELECT
  ADD_MONTHS('19-AUG-14', -1)
  AS "ADD_MONTHS1"
FROM DUAL;
SELECT
  ADD_MONTHS('19-AUG-14', 11)
  AS "ADD_MONTHS2"
FROM DUAL;

SELECT
  LAST_DAY('15-FEB-14')
  AS "LAST_DAY"
FROM DUAL;
SELECT
  NEXT_DAY('15-AUG-14', 'FRIDAY')
  AS "NEXT_DAY1"
FROM DUAL;
SELECT
  NEXT_DAY('15-AUG-14', 'THURS')
  AS "NEXT_DAY2"
FROM DUAL;

SELECT
  TO_DATE('19-AUG-14') - 1
  AS "DATE_MATH1"
FROM DUAL;
SELECT
  TO_DATE('19-AUG-14') + 7
  AS "DATE_MATH2"
FROM DUAL;
SELECT
  TO_DATE('19-AUG-14') - TO_DATE('01-JAN-14')
  AS "DATE_MATH3"
FROM DUAL;
SELECT
  TO_DATE('01-JAN-14') - TO_DATE('19-AUG-14')
  AS "DATE_MATH4"
FROM DUAL;
