[Typo3] converting the date

ahmad ahmad at web4iran.com
Sat Mar 26 22:55:19 CET 2005


Hi Jesús				

We have two kind of HIJRI dates , One that is measered by MOON movement and one another measured by SUN movement like Gregorian date .  the era is the same but Ghamari's date is 11 days lesser than 365 days of Gregorian or Shamsi's date so we are in 1384 now and they are in 1427 :)

so :

1- The "Hijri Ghamari" (MOON) used in arab countries like Saudi Arabia - Iraq - Jordan - Kuwait - Qatar , Lebanon , Palesine , etc . and you entered the function for conversion . 

2- The "Hijri Shmasi" (SUN) used in persian countries like Iran , Afqanistan , Tajikistan ,etc. 
and this is the related php convertor : 
http://www.iranphp.net/modules/sections/index.php?op=viewarticle&artid=19

I think I am first Iranian who used TYPO3 :p I it seems i shall have a big mission for extending and translating this powerful cms in our country :) 


- ahmad (ahmad)
-----------------------
This thread is located in the archive at this URL:
http://typo3.org/documentation/mailing-lists/english-main-list-archive/thread/110115702/
					
> Hi Ahmad,
> 
> If all this doesn't work, I've created a little PHP code for the
> conversion of date format to Hijra for a custom project that may help
> you. If you develop an extension, please make it available for other
> users like you.
> 
> 
> Here is the function I did:
> 
> unction hijra($day,$month,$year) {
> 
> if
> (($year>1582)||(($year==1582)&&($month>10))||(($year==1582)&&($month==10)&&($day>14)))
> {
> 
> $jd=intval((1461*($year+4800+intval(($month-14)/12)))/4)+intval((367*($month-2-12*(intval(($month-14)/12))))/12)-intval((3*(intval(($year+4900+
> intval(($month-14)/12))/100)))/4)+$day-32075;
> }
> else
> {
> $jd =
> 367*$year-intval((7*($year+5001+intval(($month-9)/7)))/4)+intval((275*$month)/9)+$day+1729777;
> }
> 
> $l=$jd-1948440+10632;
> $n=intval(($l-1)/10631);
> $l=$l-10631*$n+354;
> 
> $j=(intval((10985-$l)/5316))*(intval((50*$l)/17719))+(intval($l/5670))*(intval((43*$l)/15238));
> 
> $l=$l-(intval((30-$j)/15))*(intval((17719*$j)/50))-(intval($j/16))*(intval((15238*$j)/43))+29;
> $month=intval((24*$l)/709);
> $day=$l-intval((709*$month)/24);
> $year=30*$n+$j-30;
> 
> // Weekday calculation (Monday, Tuesday...)
> $wdn=$jd%7;
> 
> if($wdn==0){$weekday = "Monday, ";}
> elseif($wdn==1){$weekday = "Tuesday, ";}
> elseif($wdn==2){$weekday = "Wednesday, ";}
> elseif($wdn==3){$weekday = "Thursday, ";}
> elseif($wdn==4){$weekday = "Friday, ";}
> elseif($wdn==5){$weekday = "Saturday, ";}
> elseif($wdn==6){$weekday = "Sunday, ";}
> else {$weekday = "";}
> 
> 
> 
> // Month calculation and dump
> 
> if($month==0){$month = "Monday, ";}
> elseif($month==1){$month = "Muharram";}
> elseif($month==2){$month = "Safar";}
> elseif($month==3){$month = "Rabi I";}
> elseif($month==4){$month = "Rabi II";}
> elseif($month==5){$month = "Jumada I";}
> elseif($month==6){$month = "Jumada II";}
> elseif($month==7){$month = "Rajab";}
> elseif($month==8){$month = "Sha'ban";}
> elseif($month==9){$month = "Ramadan";}
> elseif($month==10){$month = "Shawwal";}
> elseif($month==11){$month = "Dhu'l-Qa'dah";}
> elseif($month==12){$month = "Dhu'l-Hijja";}
> else {$month = "";}
> 
> 
> 
> 
> echo ($weekday . $day . ' ' . $month . ' ' . $year);
> }
> 
> 
> Regards,
> 
> Jesús H.
> 
> 
> 
> 
> ahmad wrote:
> > Hi Stanislas
> >
> > Thank you for your attention .
> >
> > That is not only a format , it is a separate calendar date at all , we are
> now in 1384-01-06 :)
> >
> > Goodluck
> >
> >
> > - ahmad (ahmad)
> >
> > -----------------------
> > This thread is located in the archive at this URL:
> >
> http://typo3.org/documentation/mailing-lists/english-main-list-archive/thread/110115680/
> >
> _______________________________________________
> Typo3-english mailing list
> Typo3-english at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
> 



More information about the TYPO3-english mailing list