How to find out GMT offset value in android
问题 How to find out the values of GMT for user for example it is +05:30 for India. How do calculate this +05:30 value in Android ? I need this because I am using a java library in my app which has a function with this +05:30 field and I want to generate this field by calculation so that I wont have to fill up individual values for countries. 回答1: This is what works awesome public double getOffset(){ TimeZone timezone = TimeZone.getDefault(); int seconds = timezone.getOffset(Calendar.ZONE_OFFSET)