You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library provides a pure PHP implementation of all calendar extension functions, allowing you to use calendar functionality without requiring the calendar extension to be installed.
// Gregorian to Julian Day Count$jd = gregoriantojd(12, 25, 2024); // December 25, 2024// Julian Day Count to Gregorian$date = jdtogregorian($jd); // "12/25/2024"// Convert to Jewish calendar$jewish = jdtojewish($jd); // "10/23/5785"
Getting Easter date
// Get Easter Sunday timestamp for 2025$easter = easter_date(2025);
echodate('Y-m-d', $easter); // 2025-04-20// Get days after March 21$days = easter_days(2025); // 30
Calendar information
// Get info about all calendars$info = cal_info();
// Get info about a specific calendar$gregorian = cal_info(CAL_GREGORIAN);
print_r($gregorian['months']); // Array of month names
Days in a month
// February 2024 (leap year)$days = cal_days_in_month(CAL_GREGORIAN, 2, 2024); // 29// February 2023 (not a leap year)$days = cal_days_in_month(CAL_GREGORIAN, 2, 2023); // 28