how to write Oracle Function For Convert Date to persian (jalali) how to write Oracle Function For Convert Date to persian (jalali) database database

how to write Oracle Function For Convert Date to persian (jalali)


You can use this statement:

select to_char(hiredate,'yyyy/mm/dd','nls_calendar=persian') from emp

hiredate is a date field, with this select hiredate is displayed in persian


First of all you must set nls_calendar to Persian like below:

Alter session set nls_calendar=persian;

Now you can change format of date like below:

Select to_char(sysdate,'yyyy/mm/dd') from dual;