Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4115266
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:33:36+00:00 2026-05-20T22:33:36+00:00

I need to be able to compute differences between two data/time values which represent

  • 0

I need to be able to compute differences between two data/time values which represent instants in (potentially) two different geographic locations.

Each input value I have is a tuple of the following:

  • A date/time value with no timezone offset, for instance, 6:54 AM, 12/3/2005.
  • A latitude/longitude value (e.g., -33.8704, 151.1938) describing the location of the specific time.

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:

  • Normalise each of the input values into their relevant GMT (or Zulu) time. I imagine this can be done by converting lat/long values into a timezone. Once a related timezone is obtained, I then need to account for daylight savings differences according to the specified date to determine an accurate time.
  • Once the time values have been normalized, computing the difference is trivial.

Can anyone please suggest how I can:

  1. Convert a lat/long pair into a timezone, and
  2. Determine the daylight savings offset for a given timezone and a date.

I imagine I need some function for (1) and a database of values for (2), but I do not know where I can get these, or if they are freely available.

Other constraints:

  • I would like software in Java or .Net (as my software application can use plugins written in either), and
  • I really would like all processing to be local. I am aware that there exist several web services out there to compute the timezone for a lat/long pair (as discussed on this Stackoverflow question 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.

UPDATE: Thanks to all those who provided answers so far. I am currently trying to tackle this problem by using the GeoNames data 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 tz database for computing daylight savings offsets for particular dates.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T22:33:36+00:00Added an answer on May 20, 2026 at 10:33 pm

    Once you’ve got a time zone, you don’t need to perform the DST checking yourself – the Java TimeZone, Joda Time DateTimeZone and .NET TimeZoneInfo classes will take care of that for you.

    (If you’re using Java, I’d strongly recommend using Joda Time instead of the built-in calendar classes.)

    I don’t know of any libraries to convert a lat/long to a time zone, I’m afraid. I’m sure there must be something available, but I don’t know it offhand. Note that any such library is likely to give you a zoneinfo style name (e.g. “Europe/London”) which isn’t what the .NET TimeZoneInfo class uses, unfortunately. If Noda Time were ready, I’d suggest using that instead of .NET, but we haven’t finished it yet 🙁

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to be able to merge two (very simple) JavaScript objects at runtime.
I need to be able to take a string like: '''foo, bar, one, two,
I need to be able to create basic MS Project items (tasks, projects, resources,
I need to be able to get at the full URL of the page
I need to be able to get a list of the groups a user
I need to be able to load the entire contents of a text file
I need to be able to quickly convert an image (inside a rails controller)
I need to be able to GZip compress a file in an Excel VBA
I need to be able to periodically send email alerts to subscribed users. PHP
I need to be able to launch a process and read the output into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.