/Linux-Terminal-Date-and-Time-Calculator

The date and time calculator is a shell script for Linux. It allows adding/subtracting days, hours, and minutes from dates, calculating differences between dates, with an interactive menu-driven interface for ease of use.

Primary LanguageShell

Linux-Terminal-Date-and-Time-Calculator

The date and time calculator is a shell script for Linux. It allows adding/subtracting days, hours, and minutes from dates, calculating differences between dates, with an interactive menu-driven interface for ease of use.

Table of Contents 📚

Overview 📋

The date and time calculator is a versatile and efficient tool designed to perform various operations on dates and date-time strings using shell scripting in Linux. It allows users to add or subtract days, hours, and minutes from specified dates and date-time strings, as well as calculate the differences in days, hours, or minutes between two dates or date-time strings. This script leverages the built-in date command in Linux to handle these operations, making it powerful and straightforward to use.

Features ⚙️

  • Add Days to a Date: Calculate a future date by adding a specified number of days to a given date.
  • Subtract Days from a Date: Calculate a past date by subtracting a specified number of days from a given date.
  • Add Hours to a Date-Time: Calculate a future date-time by adding a specified number of hours to a given date-time.
  • Subtract Hours from a Date-Time: Calculate a past date-time by subtracting a specified number of hours from a given date-time.
  • Add Minutes to a Date-Time: Calculate a future date-time by adding a specified number of minutes to a given date-time.
  • Subtract Minutes from a Date-Time: Calculate a past date-time by subtracting a specified number of minutes from a given date-time.
  • Calculate Difference in Days Between Two Dates: Determine the number of days between two specified dates.
  • Calculate Difference in Hours Between Two Date-Times: Determine the number of hours between two specified date-times.
  • Calculate Difference in Minutes Between Two Date-Times: Determine the number of minutes between two specified date-times.

Steps 👣

  1. Save the script to a file, for example, date_time_calculator.sh
  2. Open your terminal and navigate to the directory where you saved the script. Make the script executable with the following command:
    • chmod +x date_time_calculator.sh
  3. Then run the script by typing:
    • ./date_time_calculator.sh