SA-MP Forums Archive
[Include] JDF - Solar (Jalali) Date and Time functions - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] JDF - Solar (Jalali) Date and Time functions (/showthread.php?tid=618522)



JDF - Jalali Date [and Time] functions - mrsh - 06.10.2016

JDF - Jalali Date [and Time] functions


The Jalali calendar is a solar calendar that was used in Iran (Persia), variants of which today are still in use in Iran as well as Afghanistan. It gains approximately 1 day on the Julian calendar every 128 years. The tropical Jalali calendar (Persian: گاهشماری جلالی or تقویم جلالی‎), which inherited some aspects from the Yazdgerdi calendar, was adopted on 15 March 1079 by the Seljuk Sultan Jalal al-Din Malik Shah I (for whom it was named), based on the recommendations of a committee of astronomers, including Omar Khayyam, at the imperial observatory in his capital city of Isfahan. Month computations were based on solar transits through the zodiac, a system integrating ideas taken from Hindu calendars[citation needed], read more on Wikipedia.

Calendar conversion is based on the algorithm provided by Roozbeh Baabakaan.

Jalali Date [and Time] functions is created by Shayan Rahmani (a.k.a. MrSh) and is released under the terms of GNU GENERAL PUBLIC LICENSE v3.

Current version v1.3 [05th Feb 2018]
https://github.com/Rahm4ni/SAMP-JDF/blob/master/JDF.inc

Methods:
Код:
     * Jalali(g_y, g_m, g_d, &j_y, &j_m, &j_d)
     * Gregorian(j_y, j_m, j_d, &g_y, &g_m, &g_d)
     * JDate(year, month, day)
     * JDatestamp()
     * TimestampToJDate(Timestamp, &year, &month, &day, &hour, &minute, &second, HourGMT = 3, MinuteGMT = 30)
     * JDateToTimestamp(year, month, day)
     * ReturnJDate(timestamp)



Re: JDF - Solar (Jalali) Date and Time functions - Eoussama - 06.10.2016

Our, I can make good use of this
thank you


Re: JDF - Solar (Jalali) Date and Time functions - mrsh - 10.11.2017

Update v1.1
Quote:

Add a new function called getjdate.
More optimization!




Re: JDF - Solar (Jalali) Date and Time functions - Aliassassin123456 - 10.11.2017

Cool release
By the way you can use static constant variables or macros instead.
https://github.com/ShynRhm/SAMP-JDF/...er/JDF.inc#L23


Re: JDF - Solar (Jalali) Date and Time functions - Hassan1 - 26.11.2017

Good include rep+


Re: JDF - Solar (Jalali) Date and Time functions - linuxthefish - 26.11.2017

jazakallah


Re: JDF - Solar (Jalali) Date and Time functions - mrsh - 05.02.2018

v1.2 Skipped...
Updated to v1.3
Quote:

All methods renamed with new ones.
Added 4 new methods (JDatestamp, TimestampToJDate, JDateToTimestamp & ReturnJDate)
Fixed Gregorian to Jalali converted date leap year bug.