[Include] JDF - Solar (Jalali) Date and Time functions
#1

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)
Reply
#2

Our, I can make good use of this
thank you
Reply
#3

Update v1.1
Quote:

Add a new function called getjdate.
More optimization!

Reply
#4

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

Good include rep+
Reply
#6

jazakallah
Reply
#7

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.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)