Created
November 26, 2025 08:33
-
-
Save phothinmg/279ba0b634f9903f5aab64711da187bc to your computer and use it in GitHub Desktop.
The position of the year in current 'Julian Period'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //By Pho Thin Mg <phothinmg@lwe8.net> | |
| //Released as public domain | |
| // The position of the year within the 28 years 'Solar Cycle'. | |
| function solorNumber(year: number): number { | |
| return ((year + 8) % 28) + 1; | |
| } | |
| // The position of the year within the 19 years 'Lunar cycle (Metonic cycle)'. | |
| function lunarNumber(year: number): number { | |
| return (year % 19) + 1; | |
| } | |
| // The position of the year within the 15 years 'Indiction cycle (taxation cycle)'. | |
| function indictionNumber(year: number): number { | |
| return ((year + 2) % 15) + 1; | |
| } | |
| // The position of the year in current 'Julian Period'. | |
| function julianPeriodYear(year: number): number { | |
| return ( | |
| (6916 * indictionNumber(year) + | |
| 4200 * lunarNumber(year) + | |
| 4845 * solorNumber(year)) % | |
| (15 * 19 * 28) | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment