PHP Zmanim Library Enables Precise Solar Calculations for Religious Timekeeping
A developer has published a tutorial demonstrating how to use the PHP Zmanim library — a port of the KosherJava project — to calculate the exact time the sun reaches a specific elevation for a given location and date. The guide focuses on a practical example: determining when the sun is 20 degrees above the horizon in Cleveland, Ohio, on June 10, 2025. Key to the implementation are two PHP classes, GeoLocation and ComplexZmanimCalendar, which accept latitude, longitude, elevation, timezone, and date as inputs. The tutorial also clarifies a counterintuitive degree convention used by the getSunriseOffsetByDegrees function, where 90 degrees represents the horizon and 0 degrees represents the zenith. The author notes that while daytime solar positions have general uses, the library is especially valuable for religious communities that require astronomically precise times for observances such as Shabbat and Jewish holidays.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in