2

I want to convert timezone of one city to another, using Joda DateTime, the process is straight forward, but I have a problem.

I am referring to Joda Database and I am unable to locate specific cities, in the database there are so few mappings say for e.g. Asia/Kolkata, if I want to search timezone for say another city like Asia/New Delhi which is in Asia or more specifically India, I cannot do that, it is mostly probable that cities within the same country have same time zone but its not always true, so I am stuck in understanding of as how to map a city to its country and vice versa.

But there is no mapping found for cities other than what is speicified in the database.

Is there any way other than or including Joda Datetime which I can use to convert by directly inputting the city name in Olson format?

I have seen many websites 1, 2 which do what I want, please help me understand what I am missing here.

Arif Nadeem
  • 8,524
  • 7
  • 47
  • 78
  • possible duplicate of [I need a mapping list of cities to timezones- best way to get it?](http://stackoverflow.com/questions/262264/i-need-a-mapping-list-of-cities-to-timezones-best-way-to-get-it) – durron597 Apr 30 '13 at 16:53
  • It doesn't describe how to map them. Have you tried it? – Arif Nadeem Apr 30 '13 at 17:05
  • possible duplicate of [How to get a time zone from a location?](http://stackoverflow.com/questions/16086962/how-to-get-a-time-zone-from-a-location) – Matt Johnson-Pint Apr 30 '13 at 19:27
  • Wikipedia [has a great write-up](http://en.wikipedia.org/wiki/Tz_database#Names_of_time_zones) of the naming conventions used in the Olson database. – Matt Johnson-Pint Apr 30 '13 at 19:29
  • You need Lat/Lon coordinates first. City names are not unique enough. Then, see the dup question I linked. – Matt Johnson-Pint Apr 30 '13 at 19:33

0 Answers0