<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Convert dates from between Hijri (Islamic) and gregorian in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135989#M261075</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do you mean you can't run it? &lt;/P&gt;&lt;P&gt;Run up to the proc format, not the macro sendit portion and then use the &lt;/P&gt;&lt;P&gt;islamic_to_sd function to convert the dates:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date_want=islamic_to_sd(1435,12,28);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; format date_want date9.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Oct 2014 19:21:05 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2014-10-23T19:21:05Z</dc:date>
    <item>
      <title>Convert dates from between Hijri (Islamic) and gregorian</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135983#M261069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ِDear all,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I am struggling to find a way to convert date in a file data. &lt;/SPAN&gt;Does anyone have a code that converts a Islamic date to Gregorian???&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Zana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 17:19:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135983#M261069</guid>
      <dc:creator>zana</dc:creator>
      <dc:date>2014-10-21T17:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dates from between Hijri (Islamic) and gregorian</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135984#M261070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to do the same and found a custom function ISLAMIC_TO_SD here:&lt;BR /&gt;&lt;A href="http://www.sascommunity.org/wiki/Sometimes_One_Needs_an_Option_with_Unusual_Dates" title="http://www.sascommunity.org/wiki/Sometimes_One_Needs_an_Option_with_Unusual_Dates"&gt;http://www.sascommunity.org/wiki/Sometimes_One_Needs_an_Option_with_Unusual_Dates&lt;BR /&gt;&lt;/A&gt;(Click here to download the SAS code for creating Hebrew and Islamic calendar interval datasets)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I tested it with today's date (2014-10-23) and &lt;STRONG&gt;the Islamic date is off by one day&lt;/STRONG&gt; (1435-12-28 instead of 1435-12-29).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wonder if the author of that function could help...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 10:05:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135984#M261070</guid>
      <dc:creator>stefan_r</dc:creator>
      <dc:date>2014-10-23T10:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dates from between Hijri (Islamic) and gregorian</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135985#M261071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;P&gt;But i can't run each of them. &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Please say me how can i run these cod for convert an Islamic (e.g., 1380-10-28) to gregorian date!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Best regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Zana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 12:13:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135985#M261071</guid>
      <dc:creator>zana</dc:creator>
      <dc:date>2014-10-23T12:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dates from between Hijri (Islamic) and gregorian</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135986#M261072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;I noticed that the paper referred to was from Art - perhaps he can help you?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 13:01:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135986#M261072</guid>
      <dc:creator>OS2Rules</dc:creator>
      <dc:date>2014-10-23T13:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dates from between Hijri (Islamic) and gregorian</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135987#M261073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="733023" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt; wrote that part of the code and I've sent him a note referring to this thread.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 13:54:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135987#M261073</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-10-23T13:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dates from between Hijri (Islamic) and gregorian</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135988#M261074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't forget me too. I don't know how &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Islamic&lt;/SPAN&gt; date look like. But When Art and me changed traditional Chinese date into &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; gregorian date&lt;/SPAN&gt; , we need a data contains all these traditional Chinese date which we download it from a HongKong observatory website by filename + url . Maybe you do all these followed Art and me .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good Luck. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 15:38:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135988#M261074</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-10-23T15:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dates from between Hijri (Islamic) and gregorian</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135989#M261075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do you mean you can't run it? &lt;/P&gt;&lt;P&gt;Run up to the proc format, not the macro sendit portion and then use the &lt;/P&gt;&lt;P&gt;islamic_to_sd function to convert the dates:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date_want=islamic_to_sd(1435,12,28);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; format date_want date9.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 19:21:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135989#M261075</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-10-23T19:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dates from between Hijri (Islamic) and gregorian</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135990#M261076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Iranian date is an Islamic. I need a program for calculating a duration for Iranian date.&lt;/P&gt;&lt;P&gt;When I tried by SAS to find that how many days there are between today (1393/07/30) and 5 months ago (1393/02/31), found that i'm powerless. I think that by convert date to gregorian this problem maybe solved.&lt;/P&gt;&lt;P&gt;Do you have any idea for me?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 19:54:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135990#M261076</guid>
      <dc:creator>zana</dc:creator>
      <dc:date>2014-10-23T19:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dates from between Hijri (Islamic) and gregorian</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135991#M261077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure how your Iranian calendar is formatted/structured but you could also try subtracting them directly to see if that duration would be correct directly.&lt;/P&gt;&lt;P&gt;Otherwise try the steps below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Extract your Iranian dates into their components - Year, Month, Date - making sure they are all numeric variables.&lt;/P&gt;&lt;P&gt;2. Run the attached code in the .txt file in SAS&lt;/P&gt;&lt;P&gt;3. Convert your dates to Gregorian using the islamic_to_sd(year,month,day) function as in my sample code above&lt;/P&gt;&lt;P&gt;4. Subtract your dates to get the duration.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 20:14:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135991#M261077</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-10-23T20:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dates from between Hijri (Islamic) and gregorian</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135992#M261078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Reeza,&lt;/P&gt;&lt;P&gt;Thanks all for your time and post. &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;My apologies, I'm a novice in SAS. I try to run the following code (in SAS 9.1.3), but did not work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc fcmp outlib=work.func.dates;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; function islamic_leap(year);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return(mod((year*11)+14,30)&amp;lt;11);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; endsub;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; function islamic_to_jd(year,month,day);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return((day+ceil(29.5*(month-1))+(year-1)*354+&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; floor((3+(11*year))/30)+1948439.5)-1);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; endsub;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;data test;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date_want=islamic_to_sd(1435,12,28);&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; format date_want date9.;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P&gt;ERROR 68-185: The function ISLAMIC_TO_SD is unknown, or cannot be accessed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 20:57:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135992#M261078</guid>
      <dc:creator>zana</dc:creator>
      <dc:date>2014-10-23T20:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dates from between Hijri (Islamic) and gregorian</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135993#M261079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh, yeah proc fcmp isn't until 9.2 at least.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Convert to SAS date based on the following then, assuming you do the conversion to day, month, year as indicated:&lt;/P&gt;&lt;P&gt;You can still take the difference of the dates to get duration.&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 12pt;"&gt;year=&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1435&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 12pt;"&gt;day=&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;28&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 12pt;"&gt;month=&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;12&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 12pt;"&gt;sas_date=((day+ceil(&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;29.5&lt;/STRONG&gt;&lt;/SPAN&gt;*(month-&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;))+(year-&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;)*&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;354&lt;/STRONG&gt;&lt;/SPAN&gt;+&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; floor((&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;3&lt;/STRONG&gt;&lt;/SPAN&gt;+(&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;11&lt;/STRONG&gt;&lt;/SPAN&gt;*year))/&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;30&lt;/STRONG&gt;&lt;/SPAN&gt;)+&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1948439.5&lt;/STRONG&gt;&lt;/SPAN&gt;)-&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;)-&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;2436934.5&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN style="color: #0433ff;"&gt;format&lt;/SPAN&gt; sas_date &lt;SPAN style="color: #009193;"&gt;date9.&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 22:15:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135993#M261079</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-10-23T22:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dates from between Hijri (Islamic) and gregorian</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135994#M261080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="832825" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;: Matt won't be able to check our macro's code until sometime next week, but the following should come close:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro islamic_to_jd(year,month,day);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&amp;amp;day.+ceil(29.5*(&amp;amp;month-1))+(&amp;amp;year.-1)*354+&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; floor((3+(11*&amp;amp;year.))/30)+1948439.5)-1-2436935.5&lt;/P&gt;&lt;P&gt;%mend islamic_to_jd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat islamic_date1 islamic_date2 $10.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input islamic_date1 islamic_date2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format sd1 sd2 date9.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; sd1=%islamic_to_jd(scan(islamic_date1,1,'-'),scan(islamic_date1,2,'-'),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; scan(islamic_date1,3,'-'));&lt;/P&gt;&lt;P&gt;&amp;nbsp; sd2=%islamic_to_jd(scan(islamic_date2,1,'-'),scan(islamic_date2,2,'-'),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; scan(islamic_date2,3,'-'));&lt;/P&gt;&lt;P&gt;&amp;nbsp; days_between=sd2-sd1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;1393-02-31 1393-07-30&lt;/P&gt;&lt;P&gt;1393-02-31 1435-12-28&lt;/P&gt;&lt;P&gt;1435-12-29 1436-01-17&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 22:22:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135994#M261080</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-10-23T22:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dates from between Hijri (Islamic) and gregorian</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135995#M261081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much. Please let me i add more suitable information. For example (please note) in Iranian date today is &lt;STRONG&gt;1393-08-02&lt;/STRONG&gt; (year, month, day) that it is equal &lt;STRONG&gt;October 24, 2014&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;So, my expected code is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Iranian_Date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Gregorian_Date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1392-10-11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01JAN2014&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1393-01-01&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 21MAR2014&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1393-02-31&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 21MAY2014&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1393-06-30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 21SEP2014&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1393-08-02&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 24OCT2014&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Zana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 09:36:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135995#M261081</guid>
      <dc:creator>zana</dc:creator>
      <dc:date>2014-10-24T09:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dates from between Hijri (Islamic) and gregorian</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135996#M261082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hardly thanks. But this code was wrong.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;For Iranian date duration between 1393-02-31 and 1393-07-30 is &lt;STRONG&gt;154&lt;/STRONG&gt; days not &lt;STRONG&gt;146&lt;/STRONG&gt; days.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Best regards&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 09:49:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135996#M261082</guid>
      <dc:creator>zana</dc:creator>
      <dc:date>2014-10-24T09:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dates from between Hijri (Islamic) and gregorian</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135997#M261083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;zanam When I read that &lt;A href="http://en.wikipedia.org/wiki/Islamic_calendar" title="http://en.wikipedia.org/wiki/Islamic_calendar"&gt;Islamic calendar - Wikipedia, the free encyclopedia&lt;/A&gt; the Islamic calendar may differ from country to country and may be by who is whatching the moon theres is not one but many of those.&lt;/P&gt;&lt;P&gt;In that case it is more a standard that everybody has his one for (other words, no standards). A conversion only makes sense when there is a exact definition at both sides. What is your calendar definition?&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 11:07:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135997#M261083</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-10-24T11:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dates from between Hijri (Islamic) and gregorian</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135998#M261084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@jaap is partially correct it will be hard to make an exact conversion based on a formula.&amp;nbsp; Do you have a specific date range in your data? Then you could download an online calendar and do a lookup conversion. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, given your dates how are you expecting to calculate duration, second row minus first row?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 11:26:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135998#M261084</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-10-24T11:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dates from between Hijri (Islamic) and gregorian</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135999#M261085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What I was thinking on was:&lt;/P&gt;&lt;P&gt;-&amp;nbsp; the &lt;A href="http://en.wikipedia.org/wiki/Tabular_Islamic_calendar" title="http://en.wikipedia.org/wiki/Tabular_Islamic_calendar"&gt;Tabular Islamic calendar - Wikipedia, the free encyclopedia&lt;/A&gt;. being more mathematical. But it is discrepedancy within all those different streams&lt;/P&gt;&lt;P&gt;- The day is just a numerical sequence. Every day another, next, number. Wether calculated in formulas (rounding/precion) using eg a FCMP routine with formats (in/out) should be able to cover that.&lt;/P&gt;&lt;P&gt;&amp;nbsp; The intervalds dataset to be used for dedicated intervals. It is just translating that number to some text vice versa for formats. The week interval should be able to be used but others needing a different approach..&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I missed the 9.1.3 limitation. You could upgrade to a newer version. As long you are at that one fcmp is not possible.&lt;/P&gt;&lt;P&gt;The most basic approach for formats / informats will be defining a long list of values to the associated SAS day-number vice versa, it could be generated for a defined period. inputting yyyy-mm-dd islamtic for let us say 200 years is 73000 records. &lt;BR /&gt;is that limited period a problem?&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 12:42:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/135999#M261085</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-10-24T12:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dates from between Hijri (Islamic) and gregorian</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/136000#M261086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your post.&lt;/P&gt;&lt;P&gt;Yes, unfortunately it is different between Islamic countries. For Iran, it determined as Persian date (&lt;A href="http://en.wikipedia.org/wiki/Iranian_calendars#Modern_calendar_.28Solar_Hejri.29" title="http://en.wikipedia.org/wiki/Iranian_calendars#Modern_calendar_.28Solar_Hejri.29"&gt;Iranian calendars - Wikipedia, the free encyclopedia&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Zana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 13:02:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/136000#M261086</guid>
      <dc:creator>zana</dc:creator>
      <dc:date>2014-10-24T13:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dates from between Hijri (Islamic) and gregorian</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/136001#M261087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Reeza, I have a data set with more than 10,000 records from 1365-01-01 to 1393-07-02 [28 years* 365 (days/year)].&lt;/P&gt;&lt;P&gt;I want to calculate that as second column minus first column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Zana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 13:39:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/136001#M261087</guid>
      <dc:creator>zana</dc:creator>
      <dc:date>2014-10-24T13:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dates from between Hijri (Islamic) and gregorian</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/136002#M261088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is the 4/5th column of dates in wikipedia a correct mapping for your needs?&lt;/P&gt;&lt;P&gt;&lt;A href="http://en.wikipedia.org/wiki/Iranian_calendars" title="http://en.wikipedia.org/wiki/Iranian_calendars"&gt;Iranian calendars - Wikipedia, the free encyclopedia&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 16:23:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dates-from-between-Hijri-Islamic-and-gregorian/m-p/136002#M261088</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-10-24T16:23:04Z</dc:date>
    </item>
  </channel>
</rss>

