0

I have a list of Java time zone ids and want to convert these into Python time zone ids. One way to do it is to build a dictionary manually which maps Java time zone ids to Python time zone ids. Is there any other way by which I can do this? I am working on python 2.7.6.

gvlasov
  • 18,638
  • 21
  • 74
  • 110
Swapnil
  • 159
  • 1
  • 11

2 Answers2

1

There's nothing to convert. Both Java and Python (via pytz or dateutil) work with the same set of time zones from the tz database.

If you see differences, then it may be because one of your environments doesn't have a current version. New time zones are released occasionally, but old ones are never removed. They're just converted to links to maintain backwards compatibility.

If you have a specific example where you see a zone in one but not the other (which shouldn't happen), then please update your question with the details.

See also: the timezone tag wiki.

Community
  • 1
  • 1
Matt Johnson-Pint
  • 230,703
  • 74
  • 448
  • 575
0

http://tutorials.jenkov.com/java-date-time/java-util-timezone.html

Python - Pytz - List of Timezones?

Pass the time and string of timezone. Hopefully Python contains the one you're looking for

Community
  • 1
  • 1
FirebladeDan
  • 1,069
  • 6
  • 14
  • Well this will apply only to the timezones which have same names. My concern is related to the timezones where the id names are different or do not exist in python. – Swapnil Jul 27 '15 at 22:22