Home » SQL & PL/SQL » SQL & PL/SQL » Gregorian Date to Islamic Hijri Date and Hijri Date to Gregorian Date in Oracle using pl/sql (oracle pl/sql)
Gregorian Date to Islamic Hijri Date and Hijri Date to Gregorian Date in Oracle using pl/sql [message #424894] Tue, 06 October 2009 07:39 Go to next message
saqib881
Messages: 1
Registered: October 2009
Junior Member
Please anybody can help me to convert Gregorian Date to Islamic Hijri Date and Hijri Date to Gregorian Date in Oracle using pl/sql, I have many dates in Hijri and Many in Gregorian in the column please help me know how to convert these Hijri Dates into Gregorian and vice versa
Thanks in advance
Re: Gregorian Date to Islamic Hijri Date and Hijri Date to Gregorian Date in Oracle using pl/sql [message #424896 is a reply to message #424894] Tue, 06 October 2009 07:47 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
I'm assuming that this column is a VARCHAR2, as you wouldn't be having this problem if you'd used a DATE column in the first place.

Can you give us an example of what a Hijri date looks like, and what format your Gregorian dates are stored in?
Re: Gregorian Date to Islamic Hijri Date and Hijri Date to Gregorian Date in Oracle using pl/sql [message #424912 is a reply to message #424894] Tue, 06 October 2009 08:37 Go to previous message
Michel Cadot
Messages: 63802
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL> select to_char(sysdate,'DD MONTH YYYY','NLS_CALENDAR=''Arabic Hijrah''') from dual;
TO_CHAR(SYSDATE,'DDMO
---------------------
16 ¿¿¿¿          1430

1 row selected.

SQL> select to_char(to_date('13/11/1956','DD/MM/YYYY','NLS_CALENDAR=''Gregorian'''),
  2                 'DD MONTH YYYY','NLS_CALENDAR=''Arabic Hijrah''') "13/11/1956 is"
  3  from dual;
13/11/1956 is
---------------------
09 ¿¿¿¿ ¿¿¿¿¿¿   1376

1 row selected.

Of course my SQL*Plus can't display arabic characters but you can do it.

Regards
Michel
Previous Topic: CASE/DECODE
Next Topic: Error while creating Package Body
Goto Forum:
  


Current Time: Mon Sep 26 00:48:25 CDT 2016

Total time taken to generate the page: 0.06935 seconds