Title: | Conversion Between Jalali (Persian or Solar Hijri) and Gregorian Calendar Dates |
---|---|
Description: | 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. |
Authors: | Abdollah Jalilian [aut, cre] (0000-0002-6573-0069), jdf.scr.ir [ctb] |
Maintainer: | Abdollah Jalilian <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.2.0 |
Built: | 2024-11-16 04:18:57 UTC |
Source: | https://github.com/jalilian/jalcal |
Convert Gregorian calendar date to Jalali calendar date
greg2jal(date)
greg2jal(date)
date |
An object of class Date specifying Gregorian date |
An integer vector consisting of the corresponding Jalali year, month and day
Abdollah Jalilian
greg2jal(base::Sys.Date())
greg2jal(base::Sys.Date())
Convert Gregorian calendar date to Jalali calendar date
greg2jal0(year, month, day)
greg2jal0(year, month, day)
year |
An integer specifying Gregorian year |
month |
An integer specifying Gregorian month |
day |
An integer specifying Gregorian day |
An integer vector consisting of the corresponding Jalali year, month and day
Abdollah Jalilian
greg2jal0(622, 3, 21) greg2jal0(1983, 9, 8)
greg2jal0(622, 3, 21) greg2jal0(1983, 9, 8)
Determining whether a given year is leap year
isLeap(year, cal = "Gregorian")
isLeap(year, cal = "Gregorian")
year |
An integer vector specifying given years |
cal |
A character string specifying the calender type. Only 'Gregorian' and 'Jalali' are implemented |
A logical vector of of the same length as year
which indicates wheter given years are leap years or not
Abdollah Jalilian
isLeap(1362, 'Jalali') isLeap(c(2000, 2100))
isLeap(1362, 'Jalali') isLeap(c(2000, 2100))
Convert Jalali calendar date to Gregorian calendar date
jal2greg(year, month, day, asDate = TRUE)
jal2greg(year, month, day, asDate = TRUE)
year |
An integer specifying Jalali year |
month |
An integer specifying Jalali month |
day |
An integer specifying Jalali day |
asDate |
A logical flag indicating whether the output Gregorian date must be in date format |
If asDate = TRUE
, the default case, an object of the Date
class in R
, otherwise an integer vector consisting of the Gregorian year, month and day
Abdollah Jalilian
jal2greg(1, 1, 1) jal2greg(1362, 6, 17) jal2greg(1362, 6, 17, asDate=FALSE)
jal2greg(1, 1, 1) jal2greg(1362, 6, 17) jal2greg(1362, 6, 17, asDate=FALSE)