A simple Python script to add a duration to a given start time and calculate the resulting time, including optional considerations for days of the week.
The Time Calculator is a Python script that takes a start time, a duration, and an optional starting day as inputs and calculates the resulting time. It handles time in the format HH:MM AM/PM and can also account for days of the week.
- Addition of a duration to a start time.
- Handling of AM/PM time format.
- Optional consideration of days of the week.
-
Ensure you have Python installed on your system.
-
Clone the repository to your local machine.
git clone https://github.com/aymane66/time-calculator.git
-
Navigate to the project directory:
cd time-calculator
-
Run the script using the following command:
python main.py
-
Time Handling in Python: I learned how to manipulate time in Python, including parsing time strings, performing arithmetic operations, and formatting time in a user-friendly manner.
-
User Input and Validation: Implementing user input and ensuring its validity were crucial aspects of this project. I explored methods to handle user input and incorporated error checking to enhance the robustness of the script.
-
Modular Programming: Breaking down the functionality into separate modules (
time_calculator.py
andmain.py
) allowed for a more organized and maintainable codebase. -
Working with Dates and Days of the Week: Handling days of the week and calculating days later involved dealing with date-related concepts. This project provided me with hands-on experience in managing dates and understanding how they interact with time.