Oracle PL/SQL - Date type LAST_DAY function

Introduction

The LAST_DAY function retrieves the last day of the month in the specified date.

v_dt:= LAST_DAY (date);

Demo

SQL>
SQL> declare-- from  ww w  . j a va 2  s. c o m
  2       v_dt DATE;
  3       v_form_tx  VARCHAR2(25):=
  4                  'DD-MON-YYYY HH24:MI:SS';
  5  begin
  6      v_dt:=last_day(sysdate);
  7      DBMS_OUTPUT.put_line(to_char(v_dt,v_form_tx));
  8  end;
  9  /
30-APR-2018 09:49:49

PL/SQL procedure successfully completed.

SQL>

Related Topic