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
Benign
Benign 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.
Similar Messages
-
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. -
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 -
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 -
Convert Solar Date to Hijri (the Arabic, Islamic, Lunar) Date
I wonder if it is possible in Coldfusion to convert Solar Date to Hijri Islamic Date ?
It is possible in ASP classic and ASP.NET AND SQL but not found in coldfusion server side script yet !
Would appreciate any help in this issue .http://www.sustainablegis.com/projects/icu4j/CalendarsTB.cfm
-
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. -
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. -
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 -
Convert Char. to Master Data
Hello Experts,
I have a char. in the system. And I would like to convert it to master data. Because I am going to add to an attribute.
What should I do?Hi ,
1- Go to Transaction RSD1 and Enter the technical name of your Info Object and select the change option .
2- go to Master Data/ Text Tab of Info object .
3- Select the check box With Master Data and if you need text of master data then select the With Texts check box also .
You can select short ,medium and long text as per your need .
4- Now you can see that Attribute Tab has been appeared for the Info object . You can enter display or navigation attribute as per your requirement .
Do not forget to re-activate the info object again .
Note : If your object is already used in Info provider , system will not allow to make above changes . So First remove it from Info provider and then do this changes .
Hope it helps .
Regards
Vikas Sharma
Robert Bosch -
Gurus,
It would be highly appreciable if you could help me in knowing how to convert a string to date in obiee. I know we need to use CAST function. I don't have enough material to figure it out myself.
Awaiting a reply.
Thanks.Nico - Thanks for the link, this is very helpful. Please tell me what's wrong in the following code. Am enlcosing the code and the error.
Code 1 :
CAST(CAST('31-OCT-'||CAST(YEAR("Dim - MBS Loan"."CLOSING DATE") AS CHAR) AS CHAR) AS DATE)
Error 1:
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 25137, message: ORA-25137: Data value out of range at OCI call OCIStmtExecute: select distinct D1.c1 as c1, D1.c2 as c2, D1.c3 as c3,
Code 2 :
CAST('31-OCT-'||SUBSTRING(CAST(YEAR("Dim - MBS Loan"."CLOSING DATE") AS CHAR),3,2) AS DATE)
Error 2:
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 1840, message: ORA-01840: input value not long enough for date format at OCI call OCIStmtExecute: select distinct D1.c1 as c1, D1.c2 as -
How to convert from line chart data to CSV format
Hi ,
I am using Flex 3 and AS.
I am getting data from MS SQL and display the data as line
chart this is ok.
But i want to convert this line chart data to CSV or .xsl
format.I find one example in fourms the from data grid to CSV
For this URL is
http://www.abdulqabiz.com/blog/archives/flash_and_actionscript/datagriddataexporter.php
But i want Line chart to CSV.Please help me.Line chart is a just a visual representation of some data
that's sitting in your database. Isn't it? You load this in Flex,
probably using HTTPService class, and pass it to some chart object.
Now when use says that she needs it in CSV format, you're
gonna have to send another request to the server to produce the
same data, convert into CSV or XLS format and let user download it.
Of course, if use doesn't want to download, you don't have to
go to the server, at least for CSV format. You can convert the same
data that used plot the chart to convert to CSV.
Am I missing something here?
ATTA -
Problem in converting the String to Date with time zone GMT
Hi,
When I tried to convert the string 12/05/2009 to Date, the time zone is set to BST.On the other hand, for the date 12/12/2009, the time zone is set to GMT. What should I do to get the time zone as GMT all the time.?
SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
String dateString = "12/05/2009";
System.out.println(myDate.toString());I think you are all missing the point. java.util.Date objects always alway always store the date as the number of milliseconds since 1/1/1970 UTC so the only TimeZone they have its the implicit UTC. When you use the Date.toString() method the toString() method gets the default time zone from your environment and formats the data accordingly. This means that the same Date object will, by default, produce a different result for France and Australia and the US.
So, if you have the date "12/5/2009" as a String then to convert it to a java.util.Date you must specify what TimeZone is implied. If it is your system time zone then you can just create a SimpleDateFormat object with the correct format and then use the parse() method to create the java.util.Date object and this will automatically be converted to UTC. If the date String represents some other time zone then you must explicitly set the time zone of the SimpleDateFormat object before parsing the string.
The same approach applies when converting a java.util.Date object to a String. If you want anything other than your system time zone then you must explicitly tell the SimpleDateFormat what time zone you want the result formatted for. -
Error when converting time stamp in date time time zone CST in IC
Hi Experts,
We have recently upgraded from CRM 5.0 to CRM 2007. We are using IC WEB Employee interaction center.
so when agent create service ticket in interaction center and close the ticket on same day we are getting an error saying Error when converting time stamp in date time time zone CST.
we thought there may be problem while installing SAP CRM by basis team in time zone, but we did not find any problem.
So please advice how to resolve this issue.
Regards,
TejaHi Teja,
I saw a similar message, and it was resolved by adding a timezone to the user profile defaults tab in SU3. I believe the system has been configured to convert between users' timezone and the system timezone, therefore it needs to know each users' timezone.
Regards,
Simon. -
Cannot convert from java.util.Date to java.sql.Date
In the below code am trying to get the current date and 60 days prior date:
Date todayDate;
Date Sixtydaysprior;
String DATE_FORMAT = "MM/dd/yy";
DateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
Calendar cal = Calendar.getInstance();
todayDate = sdf.parse(sdf.format(cal.getTime()));
cal.add(Calendar.DATE, -60);
Sixtydaysprior = sdf.parse(sdf.format(cal.getTime()));I have imported following files:
<%@page
import="java.util.Calendar,
java.text.SimpleDateFormat,
java.text.ParseException,
java.util.*"
%>Shows up following error msg:
Type mismatch: cannot convert from java.util.Date to java.sql.Date
Thanks.
Edited by: MiltonDetroja on May 22, 2009 11:03 AMShows up following error msg:
Type mismatch: cannot convert from java.util.Date to java.sql.Date
I don't think this exception is thrown from the portion of code you have shown. As clearly specified in exception message, you cannot cast an instance of java.util.Date to java.sql.Date. you will need to do something like this
java.util.Date today = new java.util.Date();
long t = today.getTime();
java.sql.Date dt = new java.sql.Date(t); -
How can I convert from Modbus raw data to engineering units using a formula?
Within Lookout, I have several Modbus numerical input types that do not have a linear corespondence to the Engineering values they represent. How can I display these values accurately using a formula to convert from the raw data to an engineering value?
I don't quite understand your reply. I'm using Lookout 6.0.2, logged in as Administrator, in Edit Mode. The Modbus object is named RTU06_SAV. The Active member is 30002 with an alias of SAVfmSMT_RSL.
Following your instructions, I opened Object Explorer and right-clicked on RTU06_SAV.
This opened a menu containing: Refresh, Cut, Copy, Rename, Delete, Edit connections..., Edit Data Member Configuration, Configure Network Security and Properties.
I assumed that I should select Edit Data Member Configuration, but maybe I'm wrong.
Within Data Member Configuration I can set up Linear Scaling between Raw data and Engineering data. I know how to do that, but what I need to know is how to convert Raw data to Engineering data using a formula representing a non-linear transformation (such as a converion to a logarithmic value or perhaps a formula derived by fitting the formula to a curve on a calibration chart).
Once I have this my Engineering data can be represented on a control panel as both a numeric value AND as a correctly reading Gauge. It can also be properly represented on a HyperTrend graph.
What do you suggest?
Maybe you are looking for
-
Disk Utility not working under cmd R mode
I upgraded my OS to 10.8.2. After doing so, when I do my normal system backup with Disk Utility, the system goes into sleep mode and the backup stops. I've done this many times in the past so I am not new to this. I've read a few articles/posts with
-
User_lobs and user_segments view shows different tablespace for lob segment
Hi, I am trying to move lob in different tablespace for partitioned table. I used alter table <table_name> move partition <partition_name> lob(lob_column) store as (tablespace <tablespace_name>); alter index <index_name> rebuild partition <partition_
-
Maintain diffrent prices for same material
How to maintain different prices for same material (assume that the price of the the material is varying frequently that to with high margin) But my req is need to maintain N values for same material .Is it possible?? For ex, 3 Jul Purchasing 20 Pc
-
Make Tab Invisible or Inactive
I'm developing in LabWindows/CVI 2013. I have a tab control on a panel with 3 tabs. The 3rd tab is "Future Features". Presently I have the tab set to "Initially dimmed". When the panel is displayed you can still see the tab and click on it and see a
-
New install. New install of Java for Mac Opened a new doc, text box and when scrolling through the text selections... illustrator crashes. Is it a non compatibility issue with an older program with on a new OS macBook Pro?