Arabic Hijri Date
I want to store and display dates of my application in Arabic Hijri style. Is there any function that converts american date into Arabic Hijri date...?
Or any other sollution for it..?
Note: I m using American_america.we8iso8859p1 character set and also need the sollution in the same...
Try this
alter session set NLS_CALENDAR="Arabic Hijrah" ;
When I grepped for Hijri, I got only the above one for Hijri, Hijra & Hijrah.
Also worth trying "Arabic Hijri".
Thanks,
Vinod.
Similar Messages
-
Convert georgian date to hijri date at specific date
Hi all,
I'm new in PL/SQL , I use Oracle database 10g in windows xp .
could any one help and provide me with code that accept any Georgian date
and convert it to hijri date
best regard
new user
thanksthe solution would go along the lines of
to_date(to_char(<date column>,'format model','*NLS_CALENDAR=<code for Georgian>*'),'format model', 'NLS_CALENDAR=<code for Arab/Hijri')
as per the description of to_date in the SQL reference manual.
Sybrand Bakker
Senior Oracle DBA -
Gregorian-Hijri Dates Converter
Hello Experts;
I am looking for ABAP Report/Function module for "Gregorian <=> Hijri Dates Converter".
Any assistance in this regards would be highly appriciated and points will be rewarded.
Looking forward for your usual prompt and professional advice...
Best Regards,
Aslam
You may ask... What is Hijri Calender?
<a href="http://en.wikipedia.org/wiki/Hijri">en.wikipedia.org/wiki/Hijri</a>
The Islamic calendar or Muslim calendar (also called "Hijri calendar", Arabic) is the calendar used to date events in many predominantly Muslim countries, and used by Muslims everywhere to determine the proper day on which to celebrate Islamic holy days. It is a lunar calendar having 12 lunar months in a year of about 354 days. Because this lunar year is about 11 days shorter than the solar year, Islamic holy days, although celebrated on fixed dates in their own calendar, usually shift 11 days earlier each successive solar year, such as a year of the Gregorian calendar. Islamic years are also called Hijra years because the first year was the year during which the Hijra occurred Muhammad's emigration from Mecca to Medina. Thus each numbered year is designated either H or AH, the latter being the initials of the Latin anno Hegirae (in the year of the Hijra).Hi,
use the below sub-routines in ABAP to convert Gregorian to Hijri dates and vice versa
DATA: WF_RESULT1 TYPE I,
WF_RESULT2 TYPE C,
WF_DATE1 TYPE SY-DATUM,
WF_DATE2 TYPE SY-DATUM.
*WF_DATE1 = '14271123'.
WF_DATE1 = SY-DATUM.
PERFORM F_GREGORIANTOHIJRA1 USING WF_DATE1
CHANGING WF_DATE2.
WRITE:/ WF_DATE1,WF_DATE2.
PERFORM F_HIJRATOGREGORIAN1 USING WF_DATE2
CHANGING WF_DATE1.
WRITE:/ WF_DATE1,WF_DATE2.
*& Form F_GREGORIANTOHIJRA1
text
-->P_GREG_DATEtext
-->P_HIJRA_DATtext
FORM F_GREGORIANTOHIJRA1 USING P_GREG_DATE
CHANGING P_HIJRA_DATE.
DATA: LOC_MM(2) TYPE N,
LOC_DD(2) TYPE N,
LOC_YY(4) TYPE N.
DATA: LOC_HIJ_MM(2) TYPE N,
LOC_HIJ_DD(2) TYPE N,
LOC_HIJ_YY(4) TYPE N.
DATA: LOC_JD TYPE P DECIMALS 2,
LOC_LL TYPE P DECIMALS 2,
LOC_LN TYPE P DECIMALS 2,
LOC_LJ TYPE P DECIMALS 2.
LOC_YY = P_GREG_DATE+0(4).
LOC_MM = P_GREG_DATE+4(2).
LOC_DD = P_GREG_DATE+6(2).
IF ( LOC_YY > 1582 ) OR
( LOC_YY = 1582 AND LOC_MM > 10 ) OR
( LOC_YY = 1582 AND LOC_MM = 10 AND LOC_DD > 14 ).
LOC_JD = TRUNC( ( 1461 * ( LOC_YY + 4800 + TRUNC( ( LOC_MM - 14 ) / 12 ) ) ) / 4 ) +
TRUNC( ( 367 * ( LOC_MM - 2 - 12 * ( TRUNC( ( LOC_MM - 14 ) / 12 ) ) ) ) / 12 ) -
TRUNC( ( 3 * ( TRUNC( ( LOC_YY + 4900 + TRUNC( ( LOC_MM - 14 ) / 12 ) ) / 100 ) ) ) / 4 ) + LOC_DD - 32075.
ELSE.
LOC_JD = 367 * LOC_YY - TRUNC( 7 * ( LOC_YY + 5001 + TRUNC( ( LOC_MM - 9 ) / 7 ) ) ) / 4 +
TRUNC( ( 275 * LOC_MM ) / 9 ) + LOC_DD + 1729777.
ENDIF.
LOC_LL = LOC_JD - 1948440 + 10632.
LOC_LN = TRUNC( ( LOC_LL - 1 ) / 10631 ).
LOC_LL = LOC_LL - 10631 * LOC_LN + 354.
LOC_LJ = ( TRUNC( ( 10985 - LOC_LL ) / 5316 ) ) * ( TRUNC( ( 50 * LOC_LL ) / 17719 ) ) +
( TRUNC( LOC_LL / 5670 ) ) * ( TRUNC( ( 43 * LOC_LL ) / 15238 ) ).
LOC_LL = LOC_LL - ( TRUNC( ( 30 - LOC_LJ ) / 15 ) ) * ( TRUNC( ( 17719 * LOC_LJ ) / 50 ) ) -
( TRUNC( LOC_LJ / 16 ) ) * ( TRUNC( ( 15238 * LOC_LJ ) / 43 ) ) + 29.
LOC_HIJ_MM = TRUNC( ( 24 * LOC_LL ) / 709 ).
LOC_HIJ_DD = LOC_LL - TRUNC( ( 709 * LOC_HIJ_MM ) / 24 ).
LOC_HIJ_YY = 30 * LOC_LN + LOC_LJ - 30 .
CONCATENATE LOC_HIJ_YY LOC_HIJ_MM LOC_HIJ_DD
INTO P_HIJRA_DATE.
ENDFORM. "F_HIJRATOGREGORIAN1
*& Form F_HIJRATOGREGORIAN1
text
-->P_HIJRA_DATtext
-->P_GREG_DATEtext
FORM F_HIJRATOGREGORIAN1 USING P_HIJRA_DATE
CHANGING P_GREG_DATE.
DATA: LOC_MM(2) TYPE N,
LOC_DD(2) TYPE N,
LOC_YY(4) TYPE N.
DATA: LOC_HIJ_MM TYPE I,
LOC_HIJ_DD TYPE I,
LOC_HIJ_YY TYPE I.
DATA: LOC_HIJ_MM1(2) TYPE N,
LOC_HIJ_DD1(2) TYPE N,
LOC_HIJ_YY1(4) TYPE N.
DATA: LOC_JD TYPE P DECIMALS 2,
LOC_LL TYPE P DECIMALS 2,
LOC_LN TYPE P DECIMALS 2,
LOC_LK TYPE P DECIMALS 2,
LOC_LI TYPE P DECIMALS 2,
LOC_LJ TYPE P DECIMALS 2.
LOC_YY = P_HIJRA_DATE+0(4).
LOC_MM = P_HIJRA_DATE+4(2).
LOC_DD = P_HIJRA_DATE+6(2).
LOC_JD = ( ( 11 * LOC_YY + 3 ) / 30 ) +
354 * LOC_YY + 30 * LOC_MM -
( ( LOC_MM - 1 ) / 2 ) + LOC_DD + 1948440 - 385 .
IF LOC_JD > 2299160.
LOC_LL = LOC_JD + 68569.
LOC_LN = TRUNC( ( 4 * LOC_LL ) / 146097 ).
LOC_LL = ( LOC_LL - TRUNC( ( 146097 * LOC_LN + 3 ) / 4 ) ).
LOC_LI = TRUNC( ( 4000 * ( LOC_LL + 1 ) ) / 1461001 ).
LOC_LL = ( LOC_LL - TRUNC( ( 1461 * LOC_LI ) / 4 ) + 31 ).
LOC_LJ = TRUNC( ( 80 * LOC_LL ) / 2447 ).
LOC_HIJ_DD = LOC_LL - TRUNC( ( 2447 * LOC_LJ ) / 80 ).
LOC_LL = TRUNC( LOC_LJ / 11 ).
LOC_HIJ_MM = LOC_LJ + 2 - ( 12 * LOC_LL ).
LOC_HIJ_YY = 100 * ( LOC_LN - 49 ) + LOC_LI + LOC_LL.
ELSE.
LOC_LJ = LOC_JD + 1402.
LOC_LK = TRUNC( ( LOC_LJ - 1 ) / 1461 ).
LOC_LL = LOC_LJ - 1461 * LOC_LK.
LOC_LN = TRUNC( ( LOC_LL - 1 ) / 365 ) - TRUNC( LOC_LL / 1461 ).
LOC_LI = LOC_LL - 365 * LOC_LN + 30.
LOC_LJ = TRUNC( ( 80 * LOC_LI ) / 2447 ).
LOC_HIJ_DD = LOC_LI - TRUNC( ( 2447 * LOC_LJ ) / 80 ).
LOC_LI = TRUNC( LOC_LJ / 11 ).
LOC_HIJ_MM = LOC_LJ + 2 - ( 12 * LOC_LI ).
LOC_HIJ_YY = 4 * LOC_LK + LOC_LN + LOC_LI - 4716.
ENDIF.
LOC_HIJ_MM1 = LOC_HIJ_MM.
LOC_HIJ_DD1 = LOC_HIJ_DD.
LOC_HIJ_YY1 = LOC_HIJ_YY.
CONCATENATE LOC_HIJ_YY1 LOC_HIJ_MM1 LOC_HIJ_DD1
INTO P_GREG_DATE.
ENDFORM. "F_HIJRATOGREGORIAN1 -
Dear Guyz,
anyone guide me how to get hijri date with the format (i.e. YYYY/MM/DD ) 1420/02/25 already date store is in database in report its showing DD/MON/YYYY.
anyhelp would appreciate.
Regards
MoazamMoazam,
I guess that it is best to create a database function with:
TO_CHAR(TO_DATE(ISU_DATE,'YYYYMMDD'),'YYYYMMDD', 'NLS_CALENDAR = '''||'ARABIC HIJRAH''')
and use it in your queries every time you need to get a date.
Otherwise I think that you can probably set the NLS_CALENDAR to ARABIC HIJRAH (via a database procedure?) in a Before Report trigger and then all dates will probably be correct for the report session.
These are the 2 things that I would try.
Dave -
How to display hijri date..
hi everyone!
can someone tell how to convert georgian date into hijri date...
and if the date is some old date....
thanks and regards
Tariq.Here are a few things you might need to know.
1.How to set Calendar to "Arabic Hijrah" ?
2.How to display both Hijrah and Gregorian dates in the same select statement?
3.What is Calendar Deviation?
4.How to set deviation?
Questions & Answers
1.How to set Calendar to "Arabic Hijrah" ?
Answer
Set NLS_CALENDAR parameter in one of the following ways:
1. In the Current session :
SQL> alter session set NLS_CALENDAR="Arabic Hijrah" ;
2. All applications for a specific client:
Set NLS_CALENDAR Variable in client OS environment.
<e.g: On NT: set variable in the registry
On Unix: set UNIX environment variable in .profile/.cshrc>
3. Within SQL function:
SQL> select to_char(sysdate,'day dd month yyyy','nls_calendar=''arabic hijrah''')
from dual ;
References
<Note:30772.1>
2.How to display both Hijrah and Gregorian dates in the same select statement?
Answer
select
to_char(sysdate,'day dd month yyyy','nls_calendar=''arabic hijrah'''),
to_char(sysdate,'day dd month yyyy','nls_calendar=''gregorian''')
from dual ;
References
<bug:1302683>
3.What is Calendar Deviation?
Answer
Since Hijrah month is based on the moon complete revolution around the sun, Hijrah
Calendar has different number of days in a year than Gregorian; therefore some manual
deviation adjustement might be needed for the conversion to/from Gregorian. In other
words HIJRAH calendar is Lunar based, corrections need to be made every so often.
4.How to set deviation?
Answer
1. Shutdown the database
2. Edit lxecal.nlt (lxecal.dat in Oracle7) in $ORACLE_HOME/ocommon/nls.
e.g: to add one day after Sep-29-2000:
DEFINE calendar
calendar_name = "Arabic Hijrah"
DEFINE calendar_deviation
deviation_data = {
<"Sep-29-2000 ad">:1
ENDDEFINE calendar_deviation
ENDDEFINE calendar
Note: Gregorian date specified in the deviation should correspond to one of
29th, 30th or 31th days of the hijrah calendar.
3. Run the NLS Calendar Utility lxegen to register your modification to Oracle calendar
system, this utility generates lxecalah.nlb file in the same directory mentioned above.
4. startup the database.
The same procedure can be followed to subtract days, but number specified in the
deviation_data should be greater than 10.
<e.g: 11 --> subtract one day, 12 --> subtract two days ...etc>
References
Hope this helps
Regards
Grant Ronald
Forms Product Management -
Difference between real Hijri Date with Oracle Hijri date
Dear ALL,
I will appreciate if any one please let me the solution for this problem. In my application I show the Date in Hijri using the NLS setting. but the issue that "i face a deference between the real hijri date with oracle hijri date"
Assume that the real hijri date on 18-SEP-2012 was 02/11/1433 in hijri but in oracle was 03/11/1433
when I execute the following query it shows me "1433/11/03", but the actual Hijri date is "1433/11/02"
select to_char(to_date('20120918','YYYYMMDD'),'YYYY/MM/DD', 'NLS_calendar='''||'ARABIC hijrah') FROM DUAL;
IFTIKHARHi,
It works correctly for me, too:
SELECT TO_CHAR ( TO_DATE ('20120918', 'YYYYMMDD')
, 'YYYY/MM/DD'
, 'NLS_calendar=''ARABIC hijrah'''
) AS h_date
FROM dual;Output:
H_DATE
1433/11/02 I tried it on Oracle versions
9.2.0.6.0
10.1.0.2.0
10.2.0.3.0
11.1.0.6.0
11.2.0.1.0
and got the same results every time. What version of Oracle are you using? What other software (front end, OS, ...)?
If it's consistently giving you the results for the day after the day wanted, then subtract 1 day before calling TO_CHAR. I know this is not a solution, just a work-around until you find and fix the real problem. -
Regarding sql function error for Hijri date to Gregorian date
Hi ,
I want to convert Hijri date format into Gregorian date format . i write the script with sql function like this
$Hijri_Date = '16/04/1428';
$Gregorian_Date = sql('DS_REPO','SELECT CONVERT(DATE,[$Hijri_Date],131)');
print($Gregorian_Date);
here $Hijri_Date data type is varchar and $Gregorian_Date data type is date.
but I am getting error like
7868 5812 DBS-070401 10/26/2010 10:37:18 PM |Session Job_Hijradata_Conversion
7868 5812 DBS-070401 10/26/2010 10:37:18 PM ODBC data source <UIPL-LAP-0013\SQLEXPRESS> error message for operation <SQLExecute>: <[Microsoft][SQL Server Native Client
7868 5812 DBS-070401 10/26/2010 10:37:18 PM 10.0][SQL Server]Explicit conversion from data type int to date is not allowed.>.
7868 5812 RUN-050304 10/26/2010 10:37:18 PM |Session Job_Hijradata_Conversion
7868 5812 RUN-050304 10/26/2010 10:37:18 PM Function call <sql ( DS_REPO, SELECT CONVERT(DATE,16/04/1428,131) ) > failed, due to error <70401>: <ODBC data source
7868 5812 RUN-050304 10/26/2010 10:37:18 PM <UIPL-LAP-0013\SQLEXPRESS> error message for operation <SQLExecute>: <[Microsoft][SQL Server Native Client 10.0][SQL
7868 5812 RUN-050304 10/26/2010 10:37:18 PM Server]Explicit conversion from data type int to date is not allowed.>.>.
7868 5812 RUN-053008 10/26/2010 10:37:18 PM |Session Job_Hijradata_Conversion
please help me out to solve this problem .
Please suggest any other solution to convert hijri date format to gregorian date format.
Thanks&Regards,
Ramana.Hi ,
In Data quality there is no inbuild function for converting hijri date to gregorian date . we have the function for converting julian date to gregorian date.
Thanks&Regards,
Ramana. -
Arabic Characters data is retrieved ??? from database
Hello
on entering Arabic Characters data is retrieved ??? from database 10G 2
any suggestions pls
my pc lang is Arabic default
my nls_lang is ARABIC_SAUDI ARABIA.AR8MSWIN1256
both for : KEY_DevSuiteHome1
and the : KEY_OraDb10g_home1
Regards,
AbdetuIf this is a recent installation and the non-Arabic data in the database isn't critical, the simplest solution would be to delete the existing database on your colleague's machine and to create a new one. Assuming you're using the DBCA to create the database, make sure when going through the installation this time that the database character set supports Arabic data (i.e. a database character set of Windows-1256 or UTF-8).
And if these databases are intended to be separate development databases for the same project, I would suggest spending some time working on developing a process to ensure that each developer's local instance is configured identically and that these configurations match the production configuration. It would be unfortunate, for example, if you were developing on a Windows-1256 database and the production database turned out to have a different character set. The simplest (though not necessarily most elegant) solution would probably to create a template using the DBCA and to use that template on each developer's machine rather than having people individually click through the installer.
Justin -
Convert Solar Hejra(Hijri) date to Anno Domini date
Hi everyone:
I am developeing an application cfm format. The company has
some paper forms that the dates are in Solar Hejra(Hijri) date
format and I need them to be converted into Anno Domini date. Do
you know any solution/tutorial or ready_to_use code in cfm format?
Or if it is not avaiable what do you seggest? I use some javascript
code? Do you know one that does it for me?
Thanks
BenignBenign wrote:
> Hi:
> Thanks for the fast reply.
> I will work on and try to make a neat convertor but do
you know any
> ready_to_use convertor? The one that only converts
Persian Date into Gregorian
> Date it is all I need.
that *is* a ready to use convertor. to convert the islamic
calendar dates to
gregorian (well to cf datetime objects) you use the
i18nDateParse function. you
can ignore the rest of the methods in that CFC (though if you
deal w/this sort
of thing once, you'll likely deal with it again). the only
tricky bit is knowing
if the original islamic dates are based on civil or religious
calendars. -
hi..i have a hijri date in a table with the value like this:
HIJRI_DATE
7/11/1426
8/11/1426
9/11/1426
10/11/1426
how can i retreived that record using HIJRI_DATE BETWEEN '7/11/1426' AND '10/11/1426'? i tried it but no records shows..
thanks.hi user,
why dont you try like following,
HIJRI_DATE BETWEEN to_date('7/11/1426','dd/mm/yyyy') AND to_date('10/11/1426','dd/mm/yyyy')
Regards
Sankar MN -
Convert gregorian to hijri date
Hi guyz,
Anyone knows how to convert gregorian to hijri date? Any function module or method?
Thanks,
Usman MalikHi Kesavadas,
Check class cl_abap_datfm
method conv_isl_to_greg_formula
It is is not working fine.
25.06.1434 = 06.05.2013 it is wrong.
25.06.1434 = 05.05.2013 it is Correct.
Please give a solution for that issue. -
Hijri Date (arabian calendar)
Gentlemen:
i'm desinging a databse schema for arabic data
is there a new data type for hijri arabian mothes?
or i should use varchar2 (text) data type
is there a ready sotred procedures for that or what?I am no quite sure if I understood your question. But you can just use the regular DATE datatype, if you need to store dates into the database. Use the NLS_CALENDAR parameter (set using ALTER SESSION or an an environment variable) to switch between the different Calendar systems including Arabic Hijrah.
-
HIJRI DATE TO GREGORIAN(NEW POST)
hi im trying to query this using sql. the table name of the column is TEST_DATE. with the following data
HIJRI_DATE
17/11/1431
18/11/1431
19/11/1431
how can i convert this data to gregorian? in sql statement?
THANKSthis May help
SQL> WITH tbl AS (SELECT to_date('17/11/1431','DD/MM/YYYY','NLS_CALENDAR=''Arabic Hijrah''') dt FROM DUAL UNION ALL
2 SELECT to_date('18/11/1431','DD/MM/YYYY','NLS_CALENDAR=''Arabic Hijrah''') FROM DUAL UNION ALL
3 SELECT to_date('19/11/1431','DD/MM/YYYY','NLS_CALENDAR=''Arabic Hijrah''') FROM DUAL
4 )
5 SELECT dt,to_char(dt,'dd/mm/yyyy','NLS_CALENDAR=Gregorian')
6 FROM tbl;
DT TO_CHAR(DT
25-OCT-10 25/10/2010
26-OCT-10 26/10/2010
27-OCT-10 27/10/2010
SQL> WITH tbl AS (SELECT to_date('17/11/1431','DD/MM/YYYY','NLS_CALENDAR=Gregorian') dt FROM DUAL UNION ALL
2 SELECT to_date('18/11/1431','DD/MM/YYYY','NLS_CALENDAR=Gregorian') FROM DUAL UNION ALL
3 SELECT to_date('19/11/1431','DD/MM/YYYY','NLS_CALENDAR=Gregorian') FROM DUAL
4 )
5 SELECT dt ,to_char(dt,'dd/mm/yyyy','NLS_CALENDAR=''Arabic Hijrah''')
6 FROM tbl;
DT TO_CHAR(DT
17-NOV-31 11/03/0835
18-NOV-31 12/03/0835
19-NOV-31 13/03/0835 -
What database setting is needed to support ARABIC language data ?
Hi All
What is the Oracle Database 10g Express Edition Release 10.2.0.1.0 setting that will let APEX store and display ARABIC data properly ?
Thank you.Hello Ahmed,
First, you’re welcome.
Second, a bit of self promotion, but if you are using APEX to develop in Arabic you might find my book interesting as it includes a special chapter on APEX Right-To-Left support.
Regards,
Arie.
♦ Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
♦ Author of Oracle Application Express 3.2 – The Essentials and More -
Guys .. I have tables that contain CLOB data fields in arabic.. and when I'm having a report on these tables , the disp of atahe report crashs ( in other word, the report content mixed )
also ..
in case i want to export the report to csv file.. the arabic content is not encoded and it being displayed as quistion marks (???????)
Any help guys ,,,i ready need itHello,
" and when I'm having a report on these tables , the disp of atahe report crashs ( in other word, the report content mixed )"Arabic is written from right to left. Are you setting the orientation of your page report correctly?
You can set it on a page level, using the style attribute "direction : rtl" on the page 'body' tag (using CSS) or on your page header. You can also set it on a specific column, using the same attribute.
in case i want to export the report to csv file.. the arabic content is not encoded and it being displayed as quistion marks (???????)APEX is exporting all its files in utf-8. Your question mark characters probably indicate that your client can't read utf-8. In addition, you should go to the globalization definitions of your application, and set the "Automatic CSV Encoding" to "Yes".
Regards,
Arie.
Message was edited by:
ageller1
Maybe you are looking for
-
Is there a way to prevent children from changing or deleting Family Share calendar events?
We recently set up Family Share. My wife and I have been sharing a calendar to coordinate our efforts keeping up with all the activities the family is involved in. We recently started to migrate some of our shared events to the Family Share calendar,
-
Changing date & time could cause the expiration on rented movie...
well, it was actually happened to me. at that time I didn't believe it. I posted this problem for finding some answers. but nobody hasn't have that yet. here is the question. after starting movie on your mac or PC, transfer it to touch. at that time
-
Repercussions of importing more than 50 users?
Does anyone know what the repercussions are of importing more than 50 users in the workgroup mode? I have about 250 users to import so that they can use the iCal service, and upon importing my 51st, I was warned that the recommended maximum of import
-
Doubt about the concept of HashSet and LinkedHashSet
I read one of the SCJP 6 exam book, when talking about Set, it gives one definition: When using HashSet or LinkedHashSet, the objects you add to them must override hashCode(). If they don't override hashCode(), the default Object. hashCode() method w
-
Recurring meetings or tasks?
Hi everyone, Is there a way to schedule recurring meetings/tasks/events in a users calendar? Best regards, John