title: How to extract the UTC offset of a specific date and time using bash?
body: <p>To be specific I do not want    <code>date +%z</code> or    <code>date -R</code> for the current local time, but I need something very similar that should work for any date in the past. For example, something like: </p>
  
  <p><code>command 2018-04-01 12:33:45</code> </p>
  
  <p>should return the UTC offset (assume Chicago as my local time zone) at 12:33:45 on 1st April 2018 local time, Chicago time for example. </p>
  
  <p>I searched extensively and there, probably, is no question close to this one, everyone wants current offset not date-time specific one, therefore it is not a duplicate. </p>
  
  <p>Thanks very much</p>
  
  <p>Update:</p>
  
  <p>I have found something <a href="https://stackoverflow.com/questions/16027776/getting-a-previous-date-in-bash-unix">here</a>, that asnwers how to get past dates using <code>date</code> command, then I have combined it with <code>-R</code> to get something close to what I want:</p>
  
  <p><code>date -d "35 days ago" -R</code></p>
  
  <p>I can go 35 days back and get the UTC offset.</p>