In developerWorks DataPower forum thread Date Conversion from Gregorain to Hijri Asif asked on how to convert Date to Hijri. Wikipedia told me that Hijri is the islamic calendar. External links section showed Calendar Converter link (http://www.fourmilab.ch/documents/calendar/) and that site is pretty cool. It converts date entered in one format to many others (Gregorian, Julian day, Julian, Hebrew, Islamic, Persian, Mayan, Bahá'í, Indian Civil, French Republican, ISO-8601, Unix time(), Excel Serial Day Number).
First lets see both in action, against XSLT and GatewayScript coproc2 endpoints:
$ echo "<foobar/>" | coproc2 gregorian_to_islamic.xsl - http://dp1-l3:2223;echo1435 Sha`ban 13 yawm al-khamis$$ echo " 'foobar' " | coproc2 gregorian_to_islamic.js - http://dp1-l3:22271435 Sha`ban 13 yawm al-khamis$
OK, here is stylesheet gregorian_to_islamic.xsl more or less straight translated to XSLT (the needed parts only).
Since the complete work is done in the modules, gregorian_to_islamic.js is minimal: