Giter VIP home page Giter VIP logo

tahajjud-calculator's Introduction

Tahajjud Calculator

Tahajjud Calculator is a Command-Line Application written in C++ to calculate Tahajjud Times. User will input the Maghrib time and the next day's Fajr time and this application will calculate the time Tahajjud starts.

Tahajjud Definition

Muslims pray 5 times daily and in addition to that, some will pray Tahajjud time at night for extra benefits.

"The best time for Tahajjud is the last third portion of the night." (Abu Hurairah:Fiqh)

From the above definition, it is implied that the Tahajjud time starts at the β…” marker between Maghrib time and Fajr time. It ends about 10 to 15 minutes before Fajr time starts.

Worked Example

The following is a real life example for calculating Tahajjud starting time. This example is taken from Singapore for the date 13th November 2019.

Data

Parameters Values
Country Singapore (GMT +08:00)
Date 13th November 2019
Maghrib 6:51 pm
Isha 8:04 pm (for reference only, not required for calculation)
Next Day Fajr 5:27 am

Source: https://www.muis.gov.sg/-/media/Files/Corporate-Site/Prayer-Timetable-2019.pdf

Algorithm

The following steps are used to calculate the Tahajjud starting time:

Step 1

Calculate the exact time difference () between Maghrib () and next day Fajr ().

Step 2

Calculate the time interval () for one-third by dividing by 3.

Step 3

Either add twice the to or subtract from . This result will be the Tahajjud starting time ().

<or>

Calculation

We have

  1. Maghrib time: = 6:51 pm [18:51]
  2. Next day Fajr time: = 5:27 am [05:27]

Following the Algorithm:

Note: Actual time is in [square brackets] converted to 24-hour format and time interval is written normally

Step 1

= [05:27 + 1 day] - [18:51]

= 10:36 (10 hours and 36 minutes)

Step 2

= [10:36]

= 3:32 (3 hours and 32 minutes)

Step 3

= [18:51] + 2*(03:32)

= [18:51] + 7:04

= [25:55]

= [01:55 + 1 day] (next day 1:55 am)

<or>

= [05:27 + 1 day] - 03:32

= [01:55 + 1 day] (next day 1:55 am)

Timeline Plot

Here is a timeline showing the calculated values:

tahajjud-calculator's People

Contributors

alkaffahamed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tahajjud-calculator's Issues

Release?

Is there going to be a release candidate for this? I don’t know how to compile it :/ Looks to be promising though.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.