0

I have been looking for the last week for a java code that will show me where in the world is 9 o'clock in the morning, and what timezone. Any help with this will be appreciated. Thanks

BobH
  • 1

1 Answers1

0

With fairly low effort you could get the time in all timezones, or just quickly calculate how many hours to add/subtract from the local timezone to determine which one is 9AM based on the code in this answer.

You could then create a small map of timezone to list of cities and pick one from the list.

Map<String, List<String>> timezoneToCities = new HashMap<>(); timezoneToCities.put("GMT+1", Arrays.asList("Paris", "Madrid"));

Unfortunately places move in and out of timezones at various times of the year, so it would be quite difficult to keep track.

Community
  • 1
  • 1
Stuart Gilbert
  • 176
  • 1
  • 4