Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A free software for Jalali and shamsi date to get current date in jalali calendar.

License

NotificationsYou must be signed in to change notification settings

BaseMax/jdate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

A free software for Jalali and shamsi date to get current date in jalali calendar.

Features

  • Convert date to jalali, shamsi calendar and getting current date
  • Getting name of days (day of week)
  • Getting name of months

Using

$ jdate --auto

1399/1/3 - فروردين - يکشنبه

$ jdate 2020 03 22

1399/1/3 - فروردين - يکشنبه

Compiling

$ cd src/$ gcc jdate.c -o jdate -O3$ move jdate /usr/bin/

Dependencies

It will use$ date if you pass--auto argument.

Jalali calendar help

The Persian Calendar

The Persian calendar is a solar calendar with a starting point that matches that of the Islamiccalendar. Apart from that, the two calendars are not related. The origin of the Persian calendar canbe traced back to the 11th century when a group of astronomers (including the well-known poet OmarKhayyam, pictured above) created what is known as the Jalaali calendar. However, a number of changes have been madeto the calendar since then.

The current calendar has been used in Iran since 1925 and in Afghanistan since 1957. However,Afghanistan used the Islamic calendar in the years 1999-2002.

The names and lengths of the 12 months that comprise the Persian year are:

1.Farvardin(31 days)7.Mehr(30 days)
2.Ordibehesht(31 days)8.Aban(30 days)
3.Khordad(31 days)9.Azar(30 days)
4.Tir(31 days)10.Day(30 days)
5.Mordad(31 days)11.Bahman(30 days)
6.Shahrivar(31 days)12.Esfand(29/30 days)

(Due to different transliterations of the Persian alphabet, other spellings of the months arepossible.) In Afghanistan the months are named differently.

The month of Esfand has 29 days in an ordinary year, 30 days in a leap year.

The Persian year starts at vernal equinox. If the astronomical vernal equinox falls before noon(Tehran true time) on a particular day, then that day is the first day of the year. If theastronomical vernal equinox falls after noon, the following day is the first day of the year.

As in the Islamic calendar, years are counted sinceMohammed’semigration to Medina in AD 622. At vernal equinox of that year, AP 1 started (AP =Anno Persico/Anno Persarum = Persian year).

Note that contrary to the Islamic calendar, the Persian calendar counts solar years. In the yearAD 2011 we have therefore witnessed the start of Persian year 1390, but the start of Islamicyear 1432.

Since the Persian year is defined by the astronomical vernal equinox, the answer is simply: Leapyears are years in which there are 366 days between two Persian new year’s days.

However, basing the Persian calendar purely on an astronomical observation of the vernal equinoxis rejected by many, and a few mathematical rules for determining the length of the year have beensuggested.

The most popular (and complex) of these is probably the following:

The calendar is divided into periods of 2820 years. These periods arethen divided into 88 cycles whose lengths follow this pattern:

29, 33, 33, 33, 29, 33, 33, 33, 29, 33, 33, 33, ...

This gives 2816 years. The total of 2820 years is achieved by extending the last cycle by 4 years(for a total of 37 years).

If you number the years within each cycle starting with 0, then leap years are the years that aredivisible by 4, except that the year 0 is not a leap year.

So within, say, a 29 year cycle, this is the leap year pattern:

YearTypeYearTypeYearTypeYearType
0Ordinary8Leap16Leap24Leap
1Ordinary9Ordinary17Ordinary25Ordinary
2Ordinary10Ordinary18Ordinary26Ordinary
3Ordinary11Ordinary19Ordinary27Ordinary
4Leap12Leap20Leap28Leap
5Ordinary13Ordinary21Ordinary
6Ordinary14Ordinary22Ordinary
7Ordinary15Ordinary23Ordinary

This gives a total of 683 leap years every 2820 years, which corresponds to an average yearlength of 365 683/2820 = 365.24220 days. This is a better approximation to thetropical year than the 365.2425 days of the Gregorian calendar.

The current 2820 year period started in the year AP 475 (AD 1096).

This “mathematical” calendar currently coincides closely with the purely astronomicalcalendar. In the years between AP 1244 and 1531 (AD 1865 and 2152) a discrepancy of oneday is seen twice, namely in AP 1404 and 1437 (starting at vernal equinox of AD 2025 and2058). However, outside this period, discrepancies are more frequent.


Max Base

My nickname is Max, Programming language developer, Full-stack programmer. I love computer scientists, researchers, and compilers. (Max Base)

Asrez Team

A team includes some programmer, developer, designer, researcher(s) especially Max Base.

Asrez Team


[8]ページ先頭

©2009-2025 Movatter.jp