Вот код, который я пробовал:
Код: Выделить всё
TimeZone timeZone = TimeZone.getDefault(); // timeZone is the good one : Europe/Paris
Calendar c = Calendar.getInstance(timeZone2);
String time = String.format("%02d" , c.get(Calendar.HOUR_OF_DAY))+":"+
String.format("%02d" , c.get(Calendar.MINUTE))+":"+ String.format("%02d" , c.get(Calendar.SECOND))+":"+
String.format("%03d" , c.get(Calendar.MILLISECOND));
// time is equal to hour of device
//I tried also something like that :
String a = new SimpleDateFormat("hh:mm:ss", Locale.getDefault()).format(c.getTime());
// Getting the same problem
Подробнее здесь: https://stackoverflow.com/questions/787 ... ur-of-zone
Мобильная версия