SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 06/10/2016, 09:50 PM   #1
mrsh
Big Clucker
 
mrsh's Avatar
 
Join Date: Sep 2011
Posts: 53
Reputation: 31
Default JDF - Jalali Date [and Time] functions

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:
Code:
     * 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)

Last edited by mrsh; 13/08/2018 at 09:47 PM.
mrsh is offline   Reply With Quote
Old 06/10/2016, 10:07 PM   #2
Eoussama
High-roller
 
Eoussama's Avatar
 
Join Date: Jul 2016
Location: Kingdom of Morocco // Tangier
Posts: 1,275
Reputation: 255
Default Re: JDF - Solar (Jalali) Date and Time functions

Our, I can make good use of this
thank you
__________________

|===[Web taxi]===|
List of my work
Github
Pastebin

|===[Interesting topics]===|
Semantic Versioning


Eoussama is offline   Reply With Quote
Old 10/11/2017, 08:05 AM   #3
mrsh
Big Clucker
 
mrsh's Avatar
 
Join Date: Sep 2011
Posts: 53
Reputation: 31
Default Re: JDF - Solar (Jalali) Date and Time functions

Update v1.1
Quote:
Add a new function called getjdate.
More optimization!
mrsh is offline   Reply With Quote
Old 10/11/2017, 08:45 AM   #4
Aliassassin123456
Huge Clucker
 
Aliassassin123456's Avatar
 
Join Date: Apr 2013
Posts: 266
Reputation: 67
Default Re: JDF - Solar (Jalali) Date and Time functions

Cool release
By the way you can use static constant variables or macros instead.
https://github.com/ShynRhm/SAMP-JDF/...er/JDF.inc#L23
__________________
My GitHub.
Founder of ArSaCiA Game Community (AKA LifeForGame), THE most popular RPG server in Iran.
Aliassassin123456 is offline   Reply With Quote
Old 26/11/2017, 11:40 AM   #5
Hassan1
Little Clucker
 
Hassan1's Avatar
 
Join Date: Feb 2016
Location: Karachi, Pakistan
Posts: 7
Reputation: 0
Default Re: JDF - Solar (Jalali) Date and Time functions

Good include rep+
__________________
Hassan1 is offline   Reply With Quote
Old 26/11/2017, 12:43 PM   #6
linuxthefish
High-roller
 
linuxthefish's Avatar
 
Join Date: Dec 2010
Location: Al-Dunya
Posts: 2,943
Reputation: 687
Default Re: JDF - Solar (Jalali) Date and Time functions

jazakallah
__________________
linuxthefish is offline   Reply With Quote
Old 05/02/2018, 08:29 AM   #7
mrsh
Big Clucker
 
mrsh's Avatar
 
Join Date: Sep 2011
Posts: 53
Reputation: 31
Default Re: JDF - Solar (Jalali) Date and Time functions

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.
mrsh is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Jalali date ?! MehranGta Scripting Help 1 16/12/2014 05:32 PM
how make date and time for last login time for user kinggta Scripting Help 3 17/06/2014 01:27 AM
Help with Time and Date Phantomkiller Scripting Help 6 07/12/2011 09:25 AM
Date & Time Mike Garber Help Archive 6 24/11/2009 06:10 PM


All times are GMT. The time now is 11:19 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.