Skip to content

Conversion Between Jalali (Persian or Solar Hijri) and Gregorian Calendar Dates

Notifications You must be signed in to change notification settings

jalilian/jalcal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CRAN_Status_Badge CRAN_Download_Count R Build Status License Last Commit

jalcal: an R package to convert Jalali and Gregorian calendar dates

Jalali, also known as Persian, Solar Hijri and Hijri Shamsi calendar is the official calendar of Iran and Afghanistan. It begins on Nowruz, the March equinox, as determined by astronomical calculation and has years of 365 or 366 days. Adapting the algorithms in https://jdf.scr.ir/, this package provides tools for converting the Jalali and Gregorian dates.

Installation

To install the package from CRAN, run the following in R:

install.packages('jalcal')

You can also install the current version of the package on GitHub by running:

require(remotes)
install_github('jalilian/jalcal')

If remotes is not installed, you should first run:

install.packages('remotes')

Usage

As examples of converting Jalali dates to Gregorian dates, simply run

require('jalcal')
jal2greg(1, 1, 1)
jal2greg(1362, 6, 17)
jal2greg(1362, 6, 17, asDate=FALSE)
jal2greg(c(1362, 1394), c(6, 3), c(17, 19))
jal2greg(c(1362, 1394), c(6, 3), c(17, 19), asDate=FALSE)

Run the following as examples of converting Gregorian dates to Jalali dates

greg2jal0(622, 3, 21)
greg2jal0(1983, 9, 8)
greg2jal0(c(1983, 2015), c(9, 6), c(8, 9))
greg2jal0(c(1983, 2015), c(9, 6), c(8, 9), asDate=TRUE)
greg2jal(base::Sys.Date())

About

Conversion Between Jalali (Persian or Solar Hijri) and Gregorian Calendar Dates

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages