Skip to content

Instantly share code, notes, and snippets.

@phothinmg
Created November 26, 2025 08:33
Show Gist options
  • Select an option

  • Save phothinmg/279ba0b634f9903f5aab64711da187bc to your computer and use it in GitHub Desktop.

Select an option

Save phothinmg/279ba0b634f9903f5aab64711da187bc to your computer and use it in GitHub Desktop.
The position of the year in current 'Julian Period'
//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