I have an input "+04:00"
What API can i use to get the timezone from this?
So far, 1) I looked into joda - https://www.joda.org/joda-time/apidocs/org/joda/time/DateTimeZone.html
static DateTimeZone forOffsetHoursMinutes(int hoursOffset, int minutesOffset)
Not sure if this is ideal.
2) I checked Timezone class.
http://docs.oracle.com/javase/6/docs/api/java/util/TimeZone.html#getTimeZone%28java.lang.String%29
getTimeZone
public static TimeZone getTimeZone(String ID)
Gets the TimeZone for the given ID.
Parameters:
ID - the ID for a TimeZone, either an abbreviation such as "PST", a full name such as "America/Los_Angeles", or a custom ID such as "GMT-8:00". Note that the support of abbreviations is for JDK 1.1.x compatibility only and full names should be used.
Returns:
the specified TimeZone, or the GMT zone if the given ID cannot be understood.
Can someone please explain how to give custom IDs as input to this function?