title: Compute difference btw. times at different locations/timezones (accounting for daylight savings)
body: <p>I need to be able to compute differences between two data/time values which represent instants in (potentially) two different geographic locations.</p>
  
  <p>Each input value I have is a tuple of the following:</p>
  
  <ul>
  <li>A date/time value with no timezone offset, for instance, <code>6:54 AM, 12/3/2005</code>.</li>
  <li>A latitude/longitude value (e.g., <code>-33.8704, 151.1938</code>) describing the location of the specific time.</li>
  </ul>
  
  <p>From any combination of two input values, I need to compute the time difference (which may be minutes, days, years, etc.). To start with, I need to: </p>
  
  <ul>
  <li><strong>Normalise</strong> each of the input values into their relevant GMT (or Zulu) time. I imagine this can be done by <strong>converting lat/long values into a timezone</strong>. Once a related timezone is obtained, I then need to <strong>account for daylight savings differences according to the specified date</strong> to determine an accurate time.</li>
  <li>Once the time values have been normalized, computing the difference is trivial.</li>
  </ul>
  
  <p><strong><em>Can anyone please suggest how I can:</em></strong></p>
  
  <ol>
  <li><strong><em>Convert a lat/long pair into a timezone</em></strong>, and </li>
  <li><strong><em>Determine the daylight savings offset for a given timezone and a date.</em></strong></li>
  </ol>
  
  <p>I imagine I need <strong>some function for (1)</strong> and a <strong>database of values for (2)</strong>, but I do not know where I can get these, or if they are freely available. </p>
  
  <p><strong>Other constraints:</strong> </p>
  
  <ul>
  <li>I would like software in Java or .Net (as my software application can use plugins written in either), and </li>
  <li>I really would like all processing to be <strong>local</strong>. I am aware that there exist several web services out there to compute the timezone for a lat/long pair (as discussed on <a href="https://stackoverflow.com/questions/41504/timezone-lookup-from-latitude-longitude">this Stackoverflow question</a> such as Geonames.org or DRTEngine), but given the amount of data I have, I do not want to rely on or hit third party web services for every data point I have, so I'd prefer 'free' software and access to all the right info locally.</li>
  </ul>
  
  <p><strong>UPDATE</strong>: Thanks to all those who provided answers so far. I am currently trying to tackle this problem by using the <a href="http://ian01.geog.psu.edu/geoserver_docs/data/geonames/installing.html" rel="nofollow noreferrer">GeoNames data</a> and performing a nearest-neighbor calculation to determine a timezone from a lat/long, and will focus on using Joda Time and the associated latest <a href="http://www.twinsun.com/tz/tz-link.htm" rel="nofollow noreferrer">tz database</a> for computing daylight savings offsets for particular dates.       </p>