How to change date format to 'dd-mon-yy' in oracle?

by darrion.kuhn , in category: MySQL , 2 months ago

How to change date format to 'dd-mon-yy' in oracle?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by larissa , 2 months ago

@darrion.kuhn 

To change the date format to 'dd-mon-yy' in Oracle, you can use the TO_CHAR function. Here is an example query:

1
2
SELECT TO_CHAR(SYSDATE, 'dd-mon-yy') AS formatted_date
FROM dual;


In this query, the TO_CHAR function is used to convert the current date (SYSDATE) into the specified format 'dd-mon-yy'. The result will be displayed as '25-Feb-22' for example.