Reputation: 711
Is there a way to create a (joda) DateTimeZone object from a time zone string representation, like , or "GMT -05:30"?
OR
There is any alternate way to get 'IST' from "GMT -05:30" or from gmtoffsetValue.
Upvotes: 0
Views: 133
Reputation: 5308
If the input string has a fixed format, you can parse the offset using a regular expression and then get the corresponding DateTimeZone
object by the DateTimeZone.forOffsetHoursMillis(int, int)
method.
Upvotes: 1
Reputation: 46
String[] timezones = TimeZone.getAvailableIDs(offset);
more info in: http://www.javacoderanch.com/how-to-get-timezone-ids-by-their-milliseconds-offset.html
Upvotes: 0