2

When i create a CalenderItem on EWS i have to set the timezone. This uses Microsoft Windows timezone strings like "Eastern Standard Time". Android has its own list of timezones which i found here https://gist.github.com/arpit/1035596, for example "America/New_York" for the one above.

How can i translate the Android values to EWS values? I already wrote a 58 entry table for another platform (bb10), but the 561 entries on github make that look futile.

edit: found a solution on the Java EWS API: https://github.com/OfficeDev/ews-java-api/blob/master/src/main/java/microsoft/exchange/webservices/data/util/TimeZoneUtils.java

slowcar
  • 314
  • 2
  • 13
  • Searching the site for [time zone name](http://stackoverflow.com/search?q=is%3Aq+time+zone+names) you will find some attempts [like this one for iOS/Windows](http://stackoverflow.com/questions/25212733/translate-time-zone-names-to-time-ids-in-xcode), but they all seem to point to 'build your own conversion'. – Jan Doggen Feb 11 '16 at 09:57
  • [This also says](http://stackoverflow.com/questions/29362120/how-to-get-the-abbreviation-country-code-of-mobile-timezone-in-android) there is no international standard for the names. – Jan Doggen Feb 11 '16 at 10:00
  • I found the solution myself, the Java EWS API contains a class that does the conversion and it seems Android uses the same timezones: https://github.com/OfficeDev/ews-java-api/blob/master/src/main/java/microsoft/exchange/webservices/data/util/TimeZoneUtils.java – slowcar Feb 17 '16 at 12:16
  • Can you make that an answer for others to see (with sample code; note that link-only answers are not appreciated)? You can answer your own questions and even mark these as the correct answer. **Do not** put the answer in the question. – Jan Doggen Feb 17 '16 at 12:17

1 Answers1

0

The Java EWS API contains a utility class that does the sought conversion. It can be found at github in the OfficeDev ews-java-api project. https://github.com/OfficeDev/ews-java-api/blob/master/src/main/java/microsoft/exchange/webservices/data/util/TimeZoneUtils.java

slowcar
  • 314
  • 2
  • 13