Download the PHP package sididev/prayer-times without Composer
On this page you can find all versions of the php package sididev/prayer-times. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sididev/prayer-times
More information about sididev/prayer-times
Files in sididev/prayer-times
Package prayer-times
Short Description An Islamic Prayer Times Library written in PHP
License MIT
Informations about the package prayer-times
Prayer Times Library
A modern PHP library for calculating Islamic prayer times based on location, date, and various calculation methods.
Installation
Install the library with Composer:
Usage
Basic Example
Get Prayer Times for a Specific Date
Different Time Formats
Custom Calculation Methods
Fine-tuning Prayer Times
You can adjust the prayer times (in minutes) to match the official times in your region:
Get Current Prayer Information
Account for Elevation
Available Calculation Methods
This library provides several predefined calculation methods:
Constant | Description |
---|---|
METHOD_MWL |
Muslim World League |
METHOD_ISNA |
Islamic Society of North America |
METHOD_EGYPT |
Egyptian General Authority of Survey |
METHOD_MAKKAH |
Umm al-Qura University, Makkah |
METHOD_KARACHI |
University of Islamic Sciences, Karachi |
METHOD_TEHRAN |
Institute of Geophysics, University of Tehran |
METHOD_JAFARI |
Shia Ithna Ashari |
METHOD_CUSTOM |
Custom parameters |
Midnight Calculation Modes
Timezone Handling
The library accepts two formats for the timezone
parameter:
- Timezone identifier:
'Europe/Paris'
,'Africa/Casablanca'
, etc. - Numeric offset:
1
(UTC+1),2
(UTC+2),-5
(UTC-5), etc.
How Calculations Are Performed
Prayer times are calculated according to the following steps:
- Astronomical calculation of the sun's position for the given date and coordinates
- Application of angles according to the chosen calculation method
- Adjustments for elevation, local preferences, etc.
- Formatting of results according to the desired format
Calculated Prayer Times
Prayer | Description |
---|---|
Imsak | Beginning of fasting (10 minutes before Fajr by default) |
Fajr | Dawn prayer |
Sunrise | Sunrise time |
Dhuhr | Noon prayer |
Asr | Afternoon prayer |
Sunset | Sunset time |
Maghrib | Sunset prayer |
Isha | Night prayer |
Midnight | Islamic midnight |
Contributing
Contributions are welcome! Feel free to open an issue or submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.