Sunnah Times
Sunnah Times
Section titled “Sunnah Times”Sunnah times are recommended times for night prayer (Qiyam/Tahajjud), derived from the period between Maghrib and Fajr.
Basic usage
Section titled “Basic usage”from datetime import datetimefrom alfalak import PrayerTimes, SunnahTimes, CalculationMethod
prayer_times = PrayerTimes( (35.7750, -78.6336), datetime.now(), CalculationMethod.MUSLIM_WORLD_LEAGUE,)sunnah = SunnahTimes(prayer_times)
print(f"Middle of the night: {sunnah.middle_of_the_night}")print(f"Last third: {sunnah.last_third_of_the_night}")What are Sunnah times?
Section titled “What are Sunnah times?”| Marker | Meaning |
|---|---|
middle_of_the_night |
Midpoint between Maghrib and Fajr |
last_third_of_the_night |
Start of the last third of the night (recommended for Qiyam) |
With timezone
Section titled “With timezone”from zoneinfo import ZoneInfo
tz = ZoneInfo("America/New_York")prayer_times = PrayerTimes( coordinates, datetime.now(), CalculationMethod.MUSLIM_WORLD_LEAGUE, time_zone=tz,)sunnah = SunnahTimes(prayer_times)DST-safe
Section titled “DST-safe”The calculation uses absolute elapsed time (UTC internally), so markers are correct even on nights with DST transitions.
See also
Section titled “See also”- API Reference — full API documentation
- Timezone Handling — timezone conversion details