Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?

like image 885
sam Avatar asked Jun 26 '12 10:06

sam


People also ask

How do I change date format from YYYY MM DD in Oracle?

Just use: select to_date(date_value, 'yyyy-mm-dd') as date_value from table; To convert to a date. That's it!

How do I insert date in YYYY MM DD in Oracle?

The TO_DATE function allows you to define the format of the date/time value. For example, we could insert the '3-may-03 21:02:44' value as follows: insert into table_name (date_field) values (TO_DATE('2003/05/03 21:02:44', 'yyyy/mm/dd hh24:mi:ss')); Learn more about the TO_DATE function.

Can we convert a date to char in Oracle?

The Oracle TO_CHAR() function converts a DATE or INTERVAL value to a string in a specified date format. The Oracle TO_CHAR() function is very useful for formatting the internal date data returned by a query in a specific date format.


1 Answers

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

like image 72
roya Avatar answered Oct 24 '22 19:10

roya