title: Get time zone offset between two timezones for a given duration
body: <p>I wanted to know if there is a way to get the time zone offset for a given date range between two timezones for a given duration.</p>
  
  <pre><code>getTimezoneOffset(startDate,endDate,timezone1,timezone2){
      ...missing magic to go here...
  }
  </code></pre>
  
  <p>should return the time zone offset which is valid for the a given duration. However if the offset changes, it should return the date range for which it's valid. </p>
  
  <p>So I am looking at something like this:</p>
  
  <pre><code>getTimezoneOFfset("march 9 12 am", "march 15 12 am", "UTC", "US/NEW_YORK")
  </code></pre>
  
  <p>return value something like this</p>
  
  <pre><code>timezoneoffset[0]["range"]=[march 9 12am to march 11 2 am]
  timezoneoffset[0]["offset"]=5
  timezoneoffset[1]["range"]=[march 9 2 am to march 15 12 am]
  timezoneoffset[1]["offset"]=4
  </code></pre>
  
  <p>I just don't want to calculate timezone offsets for every scheduled item for the given range. Was looking if there is some way to get a direct lookup for offsets if it's going to change.</p>
  
  <p>I am working with PHP, but a solution in any language will be appreciated.</p>
  
  <p>MySQL solution will also work as it will be more optimized to do this in MySQL.</p>