title: What should be ideal data structure to handle the time of day for application like Do-Not-Disturb?
body: <p>I have an application which needs to hold the following data: start time + duration, which works similar to the DND(do not disturb) service available on android/iOs.</p>
  
  <p>A user can specify start time and end time
  as 2300 hrs as start time and 0700 hrs as the end time</p>
  
  <p>I was using the following  a data_structure:-</p>
  
  <pre><code>typedef struct _timeOfDayDataStruct
  {
      unsigned int start_time;    //to hold the start time e.g 2300
      unsigned int duration_mins; //to hold the duration in minutes e.g 8
  } timeOfDayDataStruct;
  </code></pre>
  
  <p>Is it the ideal data structure, or can we do better? </p>
  
  <p>The operations required are 
  1. setting the values of start_time
  2. checking whether a given time of day is in our specified interval or not?</p>