Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to change the Mon-YY format?

Hi,
In the database, the periods are stored in the format "Mon-YY", but I need to change the format to "DD-MM-YYYY" and get the last day of the month:
Example:

select
  TO_CHAR(sysdate, 'Mon"-"yy', 'NLS_DATE_LANGUAGE=english') "Mon-YY format",
  TO_CHAR(LAST_DAY(SYSDATE), 'DD-MM-YYYY') "Last day of the month"
from dual
----------------------------------------------------------------------------------------
Result:
Mon-YY_format	Last_day_of_the_month
Jun-22	        30-06-2022

How could I change this format, is it possible?

select
  'Jun-22' "Change format with the last day of the month" -- Example 30-06-2022
from dual

Thank you.
Oracle 19c 19.0.0.0.0

This post has been answered by Frank Kulash on Jun 3 2022
Jump to Answer
Comments
Post Details
Added on Jun 3 2022
2 comments
4,204 views