sam
sam

Reputation: 1401

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

i want to convert date to Persian date (jalali) in oracle Database there is any function ?

Upvotes: 13

Views: 16082

Answers (2)

Ghs gholam hosein
Ghs gholam hosein

Reputation: 1

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;

Upvotes: -1

roya
roya

Reputation: 271

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

Upvotes: 27

Related Questions