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

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

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

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by larissa , 10 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.

Related Threads:

How to change json date to mm/dd/yy using moment.js?
How to format date dd-mmm-yyy in laravel?
How to convert timestamp to yyyy-mm-dd hh24:mi:ss format in oracle?
How to insert date in yyyy-mm -dd hh24:mi:ss in oracle?
How to compare date to format date on oracle?
How to change a date format in mysql?