SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 06/10/2016, 10:50 PM   #1
mrsh
Big Clucker
 
mrsh's Avatar
 
Join Date: Sep 2011
Posts: 51
Reputation: 25
Default JDF - Solar (Jalali) Date and Time functions

JDF - Solar (Jalali) Date and Time functions


an include that can help you to convert gregorian to jalali date or jalali to gregorian date.

For more information about Solar (Jalali) date:
https://en.wikipedia.org/wiki/Solar_Hijri_calendar

Download:
https://github.com/ShynRhm/SAMP-JDF/blob/master/JDF.inc

Repo, Readme & License:
https://github.com/ShynRhm/SAMP-JDF

Example Usage:
Code:
    new jy, jm, jd;
    gregorian_to_jalali(2016, 10, 7, jy, jm, jd);
    printf("%d/%d/%d", jy, jm, jd); //Returns: 1395/7/16

    new gy, gm, gd;
    jalali_to_gregorian(1395, 7, 16, gy, gm, gd);
    printf("%d/%d/%d", gy, gm, gd); //Returns: 2016/10/7

    new year, month, day;
    getjdate(year, month, day);
    printf("%d/%d/%d", year, month, day); //Returns Current JDate.
__________________

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

Our, I can make good use of this
thank you
__________________
Eoussama is online now   Reply With Quote
Old 10/11/2017, 09:05 AM   #3
mrsh
Big Clucker
 
mrsh's Avatar
 
Join Date: Sep 2011
Posts: 51
Reputation: 25
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, 09:45 AM   #4
Aliassassin123456
Huge Clucker
 
Aliassassin123456's Avatar
 
Join Date: Apr 2013
Posts: 259
Reputation: 62
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), most popular RPG server in Iran.
Aliassassin123456 is offline   Reply With Quote
Old 26/11/2017, 12:40 PM   #5
Hassan1
Little Clucker
 
Hassan1's Avatar
 
Join Date: Feb 2016
Location: Karachi, Pakistan
Posts: 6
Reputation: 0
Default Re: JDF - Solar (Jalali) Date and Time functions

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

jazakallah
__________________
linuxthefish 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
Solar power tower & Solar power plant Correlli Screenshots and Videos 7 11/09/2016 05:20 PM
Jalali date ?! MehranGta Scripting Help 1 16/12/2014 06:32 PM
how make date and time for last login time for user kinggta Scripting Help 3 17/06/2014 02:27 AM
Help with Time and Date Phantomkiller Scripting Help 6 07/12/2011 10:25 AM
Date & Time Mike Garber Help Archive 6 24/11/2009 07:10 PM


All times are GMT. The time now is 02:50 PM.


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