In order to get the TimeZone, we have TimeZone class in android.
For getting TimeZone of a device do the following steps:-
Step 1
Create an Object of Calender
Calender calender = Calendar.getInstance();
Step 2
Get TimeZone object by using getTimeZone() method of Calender class
TimeZone timeZone = calendar.getTimeZone();
Step 3
Obtain TimeZone:-
/**
Print device current TimeZone
**/
Log.i("TimeZone", timeZone.getId());
0 Comment(s)