What do you mean with "GMT format"? Do you mean a string like "+0200", which represents the offset in hours and minutes from GMT/UTC?
Class TimeZone has methods like getOffset() and getRawOffset() which return the offset of the timezone from UTC as an integer (a number of milliseconds). This number can easily be formatted to a string like "+0200". For example: